3 ms·
At the moment, React does not yet have support for stateful functional components. It's something they've said they would _like_ to research and implement down
by acemarke 9y ago
At the moment, React does not yet have support for stateful functional components. It's something they've said they would _like_ to research and implement down the road, but right now, component state and lifecycle methods requires class components.
- bjeanes 9y agoOr the use of something like recompose[1]'s `lifecycle` function[2]. 1: https://github.com/acdlite/recompose https://github.com/acdlite/recompose 2: https://github.com/acdlite/recompose/blob/8c4ac2e4/docs/API.md#lifecycle https://github.com/acdlite/recompose/blob/8c4ac2e4/docs/API....
- acemarke 9y agoYeah, although that itself is implemented internally using an ES6 class: https://github.com/acdlite/recompose/blob/8c4ac2e4a4cd8d60c8db9bc4cd73f0ce044fd9ca/src/packages/recompose/lifecycle.js#L16-L25 https://github.com/acdlite/recompose/blob/8c4ac2e4a4cd8d60c8...