useEffect

How to avoid API requests getting called repeatedly in your React component

If you have a React class component OR functional component, and are using fetch, axios, etc. to make a call to the server, you may want to only do that once when the component is created. This is easy to set up for both class components and function components. If you stumbled across this problem …

How to avoid API requests getting called repeatedly in your React component Read More »

useEffect hook not working right? Here are a couple of things you can check.

You can’t figure out why the UI is not updating as it should, and you’ve tried console.log and F12 and are still none the wiser. Wouldn’t it be nice if you could get past this and build and show off beautiful apps instead. This list of common misunderstandings and how to over come them will …

useEffect hook not working right? Here are a couple of things you can check. Read More »

How to create an object and hang onto it for the life of a component using hooks.

In React, the way you do code with class components vs. hooks is completely different. If you are used to classes, things you are comfortable with no longer work like that. For example: you need to keep hold of an object for the lifetime of your component. How to do that with hooks? This is …

How to create an object and hang onto it for the life of a component using hooks. Read More »