Replies: 1 comment
-
@dcalap, did you find a way to do it? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to dynamically build the chains/networks that will appear in the button based on a configuration that I will get from a backend by using Axios.
I have the wagmi.ts file where I configure the chains:
let defaultChains = [polygonMumbai, polygonZkEvmTestnet, ...(process.env.NODE_ENV === 'development' ? [polygonMumbai, polygonZkEvmTestnet] : [])];
const { chains, provider, webSocketProvider } = configureChains(
defaultChains,
[publicProvider()],
)
Is this the way to go to provide a defaultChains array based on my response? If yes, what is the way to do it? I tried and the app fails, telling me that can't use a hook there (I've tried with useEffect for calling the backend there) in that file. I'm not an expert in React.
Beta Was this translation helpful? Give feedback.
All reactions