I have connect button in a component in NextJS. I use it in a layout component to put the button in the footer.
All works good.
I notice when I buy/sell tokens in my dev environment, the connect button ābalanceā doesnāt update.
I cant figure out how I can refresh that since itās a component without any state variables (or how do you update component based on a page state variables with useEffect?)
Only way I got this to work was to use a timer to refresh whole page after buy/sell activity.
Direction is appreciatedā¦ hoping to use something at the end of function call from onClick button execution of buy or sell tokens.
/////////////////// components/layout.js
import { ConnectButton } from āweb3uikitā
const Layout = ({ children {) =>
return (
<>
<footer>
<ConnectButton moralisAuth={false}></ConnectButton>
</footer>
</>
)
}
export default Layout
/////////// _app.js
import Layout from āā¦/components/Layoutā
import { MoralisProvider } from āreact-moralisā
function MyApp({ Component, pageProps }) {
return (
<Component {ā¦pageProps} />
)
}
export default MyApp
//////////////// index.js
bunch of imports
export default function Index() {
// a bunch of code that works
return (