-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use function instead of class in component #114
Comments
Yeah, it's a great pattern & i'm all for moving in that direction. The reasons they currently aren't functions are:
from that last bullet point, this is worth a read: https://medium.com/@dan_abramov/hot-reloading-in-react-1140438583bf#.vapjtcgk7 like any big idea, it's worthwhile to let the dust settle for a couple weeks to see how the whole community handles the decision & based on community response, it may be worthwhile to use the lower-level HMR api instead. i like where your head's at though! |
Could someone explain the value of this pattern over multiple render functions in a class, or point me in the right general direction? Will a future version of react assume all functional components are pure, perhaps? |
Found stateless functional components so I'm assuming a future version of React will check argument equality before rerunning a functional component? |
it goes back to the idea of smart vs. dumb components. smart ones need lifecycle methods & HOCs & all the joys of classes. Dumb ones take in props & spit out HTML. In theory, a pure function takes less memory & rerenders faster than a class. |
Hi guys,
What do you think about using this pattern in meatier https://github.com/ghengeveld/react-redux-styleguide#components-and-containers
example of component /meatier/src/universal/modules/kanban/components/Kanban/Kanban.js
The text was updated successfully, but these errors were encountered: