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

Switch state doesn't work

Open kapilpau opened this issue 6 years ago • 2 comments

On both Android and iOS, when trying to switch state, I get: TypeError: undefined is not an object (evaluating 'u.switchState')

I get the error if I try to import TorchWithPermissionCheck or Torch from 'react-native-torch' and then run Torch.switchState(true)

kapilpau avatar Jan 04 '19 18:01 kapilpau

UPD: There no automatic linking. You have to add native module manually to your native project settings.

Original: The same issue on my side. Will try to debug

Jlexyc avatar Feb 07 '19 11:02 Jlexyc

have the same issue on iOS. android works fine. react-native: 0.61.2 . used linking command manually. for ios project imported as a pod. TypeError: null is not an object (evaluating '_reactNativeTorch.default.switchState')

UPD: It's start working after cleaning cache in Xcode and pod install command.

wandersage avatar Dec 13 '19 11:12 wandersage