I'm constructing a web app with a Sign in page as the default page displayed. When a user successfully signs in, I want to route the user to another functional component dashboard().
My app.js looks like this
function App() {
return (
<ThemeProvider theme={THEME}>
<FirebaseContext.Consumer>
{firebase => <SignIn firebase={firebase}/>}
</FirebaseContext.Consumer>
</ThemeProvider>
);
}
export default App;
SignIn is the component that contains the login form, and the action to authenticate the user.
export default function SignIn(props) {
function signInUser(){
\\Signs in a user, and redirects to Dashboard() component
}
return(...)
}
How can I redirect the user from inside the signInUser function, to another component dashboard()?