3 ms·
That was possible with earlier versions of react, with slightly different syntax: {Aquarium({ species: "rainbowfish" })} I've come across many projects wh
by wereHamster 11y ago
That was possible with earlier versions of react, with slightly different syntax:
{Aquarium({ species: "rainbowfish" })}
I've come across many projects which defined lots of small react classes, usually with a one or two line render body, which would be better served as simple functions.
- dustingetz 11y agoSort of, those functions aren't components, so they don't render async and don't have lifecycle methods or shouldComponentUpdate. (Also unclear if these new function components are actually components)
- spicyj 11y agoThey are components in that they render later, but they don't support any lifecycle methods. We'll probably add some sort of "pure" flag via static properties on the function later.