I have tried many forms of their demo codes, but the problem was always with Torch.switchState.
Does anyone knows how to fix this issue?
Thank you very much for any help.
Jan
CodePudding user response:
It looks like you're using a managed workflow, it won't work through Expo Go. You need to use a development client for native code to work. Create it with EAS.
- Install the expo-dev-client library
expo install expo-dev-client - Create an eas.json
eas build:configure - Build client and install on device/emulator
eas build -p android --profile development - Use
expo start --dev-clientinstead of 'expo start'
Docs: https://docs.expo.dev/development/getting-started/
CodePudding user response:
Did you try building the app again as this module requires linking? If not, you need to run the React Native app again.
For android run: npx react-native run-android
For ios run: npx react-native run-ios

