You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
There are references to "function components" on this page that need correction.
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 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
The text was updated successfully, but these errors were encountered: