React Terminology
Hook Functions starting with
use
are called Hooks.Effect Some components need to synchronize with external systems.
Effects let you run some code after rendering so that you can synchronize your component with some system outside of React.
Effect let you specify side effects that are caused by rendering itself, rather than by a particular event.
Don’t rush to add Effects to your components. Keep in mind that Effects are typically used to “step out” of your React code and synchronize with some external system.
Every time your component renders, React will update the screen and then run the code insideuseEffect
. In other words,useEffect
“deplays” a piece of code from running until that render is reflected on the screen.useRef
useRef
is a React Hook that lets you reference a value that’s not needed for rendering.