React (software): Difference between revisions

Content deleted Content added
18bwhite4 (talk | contribs)
Class-based components: Removed off-topic sentence.
18bwhite4 (talk | contribs)
React hooks: Changed wording and deleted superfluous Hook example.
Line 133:
[https://tekolio.com/what-are-hooks-in-react/ Hooks] are functions that let developers "hook into" React state and lifecycle features from function components.<ref>{{Cite web|url=https://reactjs.org/docs/hooks-overview.html|title=Hooks at a Glance – React|website=reactjs.org|language=en|access-date=2019-08-08}}</ref> Hooks do not work inside classes — they let you use React without classes.<ref>{{Cite web|url=https://blog.soshace.com/what-the-heck-is-react-hooks/|title=What the Heck is React Hooks?|date=2020-01-16|website=Soshace|language=en|access-date=2020-01-24}}</ref>
 
React provides a few built-in hooks like <code>useState</code>,<ref>{{Cite web|url=https://reactjs.org/docs/hooks-state.html|title=Using the State Hook – React|website=reactjs.org|language=en|access-date=2020-01-24}}</ref> <code>useContext</code>, <code>useReducer</code> , <code>useMemo</code> and <code>useEffect</code>.<ref>{{Cite web|url=https://reactjs.org/docs/hooks-effect.html|title=Using the Effect Hook – React|website=reactjs.org|language=en|access-date=2020-01-24}}</ref> Others are documented in the Hooks API Reference.<ref>{{Cite web|url=https://reactjs.org/docs/hooks-reference.html|title=Hooks API Reference – React|website=reactjs.org|language=en|access-date=2020-01-24}}</ref> <code>useState</code> , <code>useReducer</code> and <code>useEffect</code>, which are the most commonly used, are for controlling state and side effects respectively.
 
==== Rules of hooks ====