Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
45% Faster React Functional Component
import React from "react";
const Avatar = (props) => {
return <img src={props.url} />;
};
export default Avatar;
import React from "react";
import ReactDOM from "react-dom";
import Avatar from "./components/Avatar";
const Home = () => {
return (
<div>
{Avatar({ url: avatarUrl })}
<div>{commentBody}</div>
</div>
);
}
ReactDOM.render(Home, document.querySelector("#root"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.