-
Notifications
You must be signed in to change notification settings - Fork 108
Description
There are references to "function components" on this page that need correction.
State hoisting
function-component don't hold state (as the name implies).
With the introduction of hooks, function components do hold state. useState() hook in particular allows function components to store state. See https://reactjs.org/docs/hooks-state.html
This pattern isn't limited to function components. Because function components don't have lifecycle events, you'll use this pattern with component classes as well.
This is inaccurate as well. Function components do have lifecycle the same way class components have. Again with the introduction of hooks, useEffect() hooks allows function component to implement all lifecycle methods that class components allows. See https://reactjs.org/docs/hooks-effect.html