Skip to content

Tag: react-hooks

Hook | Add Multiple List State

I define a list (useState ([])). I want to fill a list as data comes to index 0 of this list first. For example, a value comes every second and writes it on the list. then I want to press the button, create a new lite for the first index of the list and start filling it. How can I

Invoking function expression

I’m following a React-hooks tutorial and I don’t understand why does the function expression, timerId in the top useEffect is being invoked automatically, but the function expression, search, in the bottom useEffect requires it to be called search() in order to invoke it? Answer It is assigning a …