react-native-torch icon indicating copy to clipboard operation
react-native-torch copied to clipboard

typeerror:undefined is not an object (evaluating 'torch.switchstate')

Open 761114234 opened this issue 7 years ago • 3 comments

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')

761114234 avatar Oct 19 '18 03:10 761114234

Same problem as you

EYproductions avatar Nov 25 '18 08:11 EYproductions

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.

samyachour avatar Dec 07 '18 02:12 samyachour

Hey Rebuilding the app works for me :) so try it out

react-native run-android then try it should work

ajaymarathe avatar Dec 03 '20 18:12 ajaymarathe