cosmology-tech / cosmos-kit

Universal wallet connector for the Cosmos ⚛️
https://cosmology.zone/products/cosmos-kit
BSD 3-Clause Clear License
182 stars 132 forks source link

`<ChainProvider>` props cannot be changed after first render #370

Closed Redm4x closed 10 months ago

Redm4x commented 11 months ago

It looks like the <ChainProvider> props cannot be changed after the first render. I am asynchronously loading the preferred rpc endpoint (from user settings) and then trying to set the endpointOptions prop, but it is not used during new transactions. It always uses what was set during the first render. I am guessing it is caused by the useMemo in provider.tsx, but I could not find a workaround. Is there a way to update endpointOptions after the first render?

baktun14 commented 10 months ago

Bump

liujun93 commented 10 months ago

a new feature addEndpoints as been added in the latest version @cosmos-kit/react@2.9.14

you can follow the example code here https://github.com/cosmology-tech/cosmos-kit/blob/main/packages/example/pages/endpoint.tsx

daniel-farina commented 10 months ago

a new feature addEndpoints as been added in the latest version @cosmos-kit/react@2.9.14

you can follow the example code here https://github.com/cosmology-tech/cosmos-kit/blob/main/packages/example/pages/endpoint.tsx

This is gold and one of the much needed features in Cosmos for decentralization and less dependency on centralized infrastructure. Nice job guys.