3 ms·
I tend to heavily favor functional components[1]: function Welcome(props) { return <h1>Hello, {props.name}</h1>; } or a little nicer: const
by shepmaster 10y ago
I tend to heavily favor functional components[1]:
function Welcome(props) {
return <h1>Hello, {props.name}</h1>;
}
or a little nicer:
const Welcome = ({ name }) => (
<h1>Hello, {name}</h1>
)
[1]: https://facebook.github.io/react/docs/components-and-props.html#functional-and-class-components https://facebook.github.io/react/docs/components-and-props.h...
- Lazare 10y agoSorry, typed too fast. Edited my answer to clarify.