Skip to content
Advertisement

Return function output to component in react js

AOA, I want to return the output of useAuth.the output will be returned to ProtectedRoute component and as it is will be returned to layout.js. let me know if you need more info

Private Route.js

JavaScript

layout.js

JavaScript

Advertisement

Answer

You can not use a component returned from useEffect instead you should be using a state for this.

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement