Hey guys I know the title is a bit confusing , but im sure here you will understand better what i need. So im trying to build a social media app like instagram and at the moment im building the login component but im stuck since im still learning how to use react.So here I have my login component:
function LoginMenu (){
const [email, setEmail] = useState(null);
const [password, setPassword] = useState(null);
return (
<div style = {styles2}>
<form className="form-signin" style = {styles}>
<div className="form-label-group" >
<label htmlFor="inputEmail">
Email address
<input
type="email"
id="inputEmail"
className="form-control"
placeholder="Email address"
required
autoFocus
onChange = {event => setEmail(event.target.value)}
></input>
</label>
</div>
<div className="form-label-group" >
<label htmlFor="inputPassword">
Password
<input
type="password"
id="inputPassword"
className="form-control"
placeholder="Password"
required
onChange = {event => setPassword(event.target.value)}
></input>
</label>
</div>
<button
className="btn btn-lg btn-primary btn-block"
onClick = {() => <MainApp/>}
type="submit"
>
Sign in
</button>
</form>
</div>
);
} all I want to do is , when i click the button , the MainApp components content to take over the page and the login menu to be gone, just like it happens in every site with login screen