ReactNative useChain Error

Hi, there. I create a mobile app with ReactNative.
And I want to use useChain switch the chain from wallet(MetaMask)
but I got some error.
Anyone met this issue? Does Moralis SDK support switch network to moblie app?

the error:
AppLoading threw an unexpected error when loading:
TypeError: (0, _reactMoralis.useChain) is not a function. (In โ€˜(0, _reactMoralis.useChain)()โ€™, โ€˜(0, _reactMoralis.useChain)โ€™ is undefined)

Are you using the latest react-moralis library? If so can you share a repo of your project.

Hi,@alex
I try to fix this issue myself in past two days
Unforturnilly , I still canโ€™t fix the issues.
Please give me a hand.
this is my repo:https://github.com/AdemKao/moralis-reactnative-adapt.git
for now the error is


Thanks in advance :slight_smile:

Iโ€™m not seeing your use of useChain in Main.tsx and how youโ€™ve imported it. I havenโ€™t used Expo but I am not able to build your project locally for Android due to errors moralis-reactnative-adapt\android\gradlew.bat exited with non-zero code: 1.

This thread may help for this other error.

Hi @alex I think the problem is wallectconnect can not use in Expo.
So I clone your git project, and update the Moralis version which support useChain function
but I got other problems since I simulated on my iphone
It show :Canโ€™t find tvariable:localStorage
hereโ€™s my repo:https://github.com/BlacMarc777/moralis-react-naive
Thanks for reply.