hi im have this error using moralis login and logout crypto feature in react
import Moralis from 'moralis';
import { useState } from 'react';
const Home = props => {
const [Logout, setLogin] = useState(props.logout);
const Login = async () => {
setLogin(
Moralis.Web3.authenticate().then(function (user) {
return user;
})
)
}
let currentUser = Moralis.User.current()
//console.log(currentUser);
if(!currentUser){
return(
<div>
<button onClick = { Login} >Authenticate</button>
</div>
)
}else{
return(
<div>
<button onClick={ Logout}>logout</button>
</div>
)
}
this is the error im getting
Expected `onClick` listener to be a function, instead got a value of `object` type.
at button
at div
at Home (http://localhost:3000/static/js/main.chunk.js:523:91)
at div
at App