We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undefined is not an object (evaluating '_react2.PropTypes.string')
Hi there,
I've recently upgraded react-native
"react-native": "^0.50.4",
and react
"react": "^16.2.0",
I'm using mapbox additionally along with FBSDK, React-Native-Router-Flux, etc and I'm getting the following error
My package.json is as follows:
package.json
{ "name": "clustr", "version": "0.9.0", "private": true, "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start", "remotedev": "remotedev --hostname=localhost --port=8000", "flow": "flow" }, "dependencies": { "@mapbox/react-native-mapbox-gl": "^6.0.1", "fuzzysearch": "^1.0.3", "haversine": "^1.1.0", "lodash": "^4.17.4", "moment": "^2.19.3", "moment-business": "^3.0.1", "prop-types": "^15.6.0", "querystring": "^0.2.0", "react": "^16.2.0", "react-native": "^0.50.4", "react-native-branch": "^2.1.1", "react-native-camera": "^0.10.0", "react-native-device-info": "^0.10.2", "react-native-drawer-layout": "^1.3.0", "react-native-fbsdk": "^0.6.3", "react-native-geocoder": "^0.4.8", "react-native-hyperlink": "0.0.10", "react-native-i18n": "^1.0.0", "react-native-loading-spinner-overlay": "^0.5.2", "react-native-maps": "^0.17.1", "react-native-modalbox": "^1.3.8", "react-native-page-control": "^1.1.1", "react-native-qrcode": "^0.2.6", "react-native-qrcode-scanner": "0.0.22", "react-native-radio-buttons": "^0.14.0", "react-native-router-flux": "3.38.0", "react-native-swipe-gestures": "^1.0.2", "react-native-vector-icons": "^4.4.2", "react-redux": "^5.0.4", "redux": "^3.6.0", "redux-form": "^6.6.3", "redux-form-material-ui": "^4.3.1", "redux-saga": "^0.15.3", "remote-redux-devtools": "^0.5.7", "tipsi-stripe": "^3.9.1", "url-parse": "^1.1.9" }, "devDependencies": { "babel-plugin-module-resolver": "^2.7.0", "flow-bin": "^0.45.0", "remotedev-server": "0.2.2" }, "assets": [ "./assets/fonts" ] }
With the upgrade I've swapped over to using prop-types as follows:
prop-types
import React from 'react'; import Text from '../generic/CText'; import {Platform, TouchableOpacity, View, Image} from 'react-native'; import PropTypes from 'prop-types'; TitleBar.propTypes = { title: PropTypes.string }; export default TitleBar;
And so on, this is consistent across all of my components.
Thanks very much for your help!
The text was updated successfully, but these errors were encountered:
Seems that running
jscodeshift -t react-codemod/transforms/React-PropTypes-to-prop-types.js <path> on my project resolved the issue for the time being.
jscodeshift -t react-codemod/transforms/React-PropTypes-to-prop-types.js <path>
Sorry, something went wrong.
@MichaelStokes is the warning coming from this repo? We are using prop-types
@nitaliano It appears to be that the issue was coming from react-native-router-flux on version 0.38.0, it wasn't obvious at all, but after looking at the logs from Android Device Monitor when running the release build, I could see some related logs ... so I'd figure I'd upgrade react-native-router-flux to the latest build 4.0.0-beta.24 and the issue was resolved. Please see https://stackoverflow.com/questions/47603791/react-native-undefined-is-not-an-object-evaluating-react2-proptypes-string/47603838#47603838 for more details.
react-native-router-flux
0.38.0
4.0.0-beta.24
Cool, I'm going to close this out
No branches or pull requests
Hi there,
I've recently upgraded react-native
"react-native": "^0.50.4",
and react
"react": "^16.2.0",
I'm using mapbox additionally along with FBSDK, React-Native-Router-Flux, etc and I'm getting the following error
undefined is not an object (evaluating '_react2.PropTypes.string')
My
package.json
is as follows:With the upgrade I've swapped over to using
prop-types
as follows:And so on, this is consistent across all of my components.
Thanks very much for your help!
The text was updated successfully, but these errors were encountered: