To disable only setState message
"setState (...) can only update a mounted or mounted component." selected from 4 possible files:
- node_modules / react / dist / react-with-addons.js
- node_modules / react / dist / react.js
- node_modules / react / lib / ReactNoopUpdateQueue.js
- node_modules / react / lib / ReactUpdateQueue.js
I do not know which one your called, but you can change these files so as not to show a warning. If your problem is with your users, that is, in release mode, the dev flag is false, which means that no warning messages will be displayed.
To disable all warnings
To turn off warnings, just change this in AppDelegate.m:
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
to
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=false"];
If you are using a pre-packaged file, you need to specify dev as false when linking:
react-native bundle --dev false --entry-file index.ios.js --bundle-output ios/main.jsbundle --platform ios
source share