Anyone knows why this warning is heading up ?
another warning is : ReactNative.createElement is deprecated. Use React.createElement from "react" package instead.
Code is :
var React = require('react-native');
var {
Text,
View,
StyleSheet,
} = React;
module.exports = React.createClass({
render: function(){
return(
<View>
<Text>{this.props.titleName}</Text>
</View>
);
}
});
var styles = StyleSheet.create({
container:{
},
text:{
}
});
Importing React from react-native has been deprecated in 0.25.1. It will stop working in 0.26.
You should do this now:
import React from 'react';
import {
Text,
View,
StyleSheet,
} from 'react-native';
Edit: If you still get deprecation warnings after fixing your code, you are probably using dependencies that have not yet been updated. To fix these warnings do the following:
jscodeshift -t transform.js PATH_TO_YOUR_PROJECT/node_modules/
When you find a dependency that has not been updated it's probably a good idea to submit an issue or if you have the time a PR.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With