Hi!
The problem I have is that after reload the page value account
from useMoralis()
doesnât save.
I was looking at an example of ethereum-boilerplate and at the top right corner my address always shows despite reload the page.
https://ethereum-boilerplate.github.io/ethereum-boilerplate/quickstart
My code:
import { useMoralis } from "react-moralis";
function App() {
const { isAuthenticated, user, account} = useMoralis();
console.log(account)
if (!isAuthenticated || !account) {
return (
<div>
<button onClick={() => authenticate()}>Authenticate</button>
</div>
);
}
return (
<div>
<h1>Welcome {user.get("username")}</h1>
<h2>your account address is {account}</h2>
</div>
);
}
export default App;