React (software): Difference between revisions

Content deleted Content added
AbhiD06 (talk | contribs)
Tag: Reverted
AbhiD06 (talk | contribs)
Tag: Reverted
Line 142:
# Hooks should only be called from React function components and custom hooks, not normal functions or class components.
 
Although these rules can't be enforced at runtime, code analysis tools such as [[Lint (software)|linters]] can be configured to detect many mistakes during development. The rules apply to both usage of hooks and the implementation of custom hooks,<ref>{{Cite web|url=https://reactjs.org/docs/hooks-custom.html|title=Building Your Own Hooks – React|website=reactjs.org|language=en|access-date=2020-01-24}}</ref> which may call other hooks. <ref>{{Cite web|url= https://themeselection.com/react-hooks-tutorial-for-beginners|title=React Hooks Tutorial – React|language=en|access-date=2022-06-03}}</ref>
 
==Common idioms==