react-native-torch
react-native-torch copied to clipboard
typeerror:undefined is not an object (evaluating 'torch.switchstate')
I use: "dependencies": { "react": "16.3.1", "react-native": "0.55.4", "react-native-torch": "^1.1.4" },
... import Torch from 'react-native-torch'; ... Torch.switchState(true); ...
Same error in android: Possible Unhandled Promise Rejection(id:0): typeError:undefined is not an object(evaluating 'Torch.switchState')
Same problem as you
Try the manual install instructions
EDIT:
Found a similar thread, the consensus seemed to be you have to rebuild your app. You can't just add a library and then reload the bundler.
Hey Rebuilding the app works for me :) so try it out
react-native run-android then try it should work