Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const About = ({ isAuthMounted }) => {
- if (isAuthMounted) {
- // ...
- }
- };
- const Auth = ({ setAuthMounted }) => {
- useEffect(() => [setAuthMounted(true), () => setAuthMounted(false)], [setAuthMounted]);
- };
- const Parent = () => {
- const [isAuthMounted, setAuthMounted] = useState(false);
- return (
- <>
- <Route path="/about" component={About} {...{ isAuthMounted }} />
- <Route path="/auth" component={Auth} {...{ setAuthMounted }} />
- </>
- );
- };
Advertisement
Add Comment
Please, Sign In to add comment