Create a Custom Hook that Creates Resources

Share this video with your friends

Send Tweet

One of the coolest parts of React is the ability to take logic within a component and extract it to a reusable chunk (a custom hook or component). Let's take the logic around our resource to create a custom hook for creating a React Suspense resource.

Viktor Soroka
Viktor Soroka
~ 5 years ago

I did not get why the dependency over startTransition in the useLayoutEffect. Could you please clarify the need for this.