Importing React from response-native was deprecated in 0.25.1 . It will stop working at 0.26.
You should do it now:
import React from 'react'; import { Text, View, StyleSheet, } from 'react-native';
Change If you still get obsolescence warnings after fixing the code, you are probably using dependencies that are not yet updated. To fix these warnings, follow these steps:
- Check if there are updates available that fix the import.
- Use this script to rewrite your dependencies to automatically use the correct import. This will take quite a while and rewrite some files that have nothing to do with the reaction.
jscodeshift -t transform.js PATH_TO_YOUR_PROJECT/node_modules/ - To find the remaining files that require React from-response-native actions, you can set a breakpoint in node_modules / react-native / Libraries / ReactNative / ReactNative.js on line 41, where a warning is raised.
When you find a dependent that has not been updated, it is probably a good idea to submit a question or if you have PR time.
source share