Top "React-hooks" questions

Hooks is a new feature that allows developers to use state(s) and other React features without writing a class.

Should I use one or many useEffect in component?

I have some side effects to apply and want to know how to organize them: as a single useEffect or …

reactjs react-hooks
How to use throttle or debounce with React Hook?

I'm trying to use the throttle method from lodash in a functional component, e.g.: const App = () => { const [value, …

reactjs lodash react-hooks throttling
React useEffect causing: Can't perform a React state update on an unmounted component

When fetching data I'm getting: Can't perform a React state update on an unmounted component. The app still works, but …

javascript reactjs fetch react-hooks
How can I use multiple refs for an array of elements with hooks?

As far as I understood I can use refs for a single element like this: How can I implement this …

javascript reactjs react-hooks
Set types on useState React Hook with TypeScript

I'm migrating a React with TypeScript project to use hooks features (React v16.7.0-alpha), but I cannot figure out how …

reactjs typescript react-hooks
useRef "refers to a value, but is being used as a type here."

I'm trying to figure out how to tell react which element is being used as ref i.e. in my …

reactjs typescript react-hooks
State not updating when using React state hook within setInterval

I'm trying out the new React Hooks and have a Clock component with a counter which is supposed to increase …

javascript reactjs react-hooks
React Hooks - How do I implement shouldComponentUpdate?

I know you can tell React to skip an effect by passing an array as an optional second argument. For …

reactjs react-hooks
How to register event with useEffect hooks?

I am following a Udemy course on how to register events with hooks, the instructor gave the below code: const […

javascript reactjs react-native react-hooks
react useEffect comparing objects

I am using react useEffect hooks and checking if an object has changed and only then run the hook again. …

javascript reactjs react-hooks