Skip to content
New issue

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

Add PropTypes and update dependencies to work with react 16.0.0 #2532

Merged
merged 1 commit into from
Oct 22, 2017

Conversation

daviscabral
Copy link
Collaborator

@aksonov the PR you asked for in #69.

@aksonov aksonov merged commit 64eb030 into aksonov:v3 Oct 22, 2017
@daviscabral
Copy link
Collaborator Author

@aksonov could you please bump the version too?

@aksonov
Copy link
Owner

aksonov commented Oct 23, 2017

Done (3.42.0)

@daviscabral
Copy link
Collaborator Author

Thanks.

@ujwal-setlur
Copy link

This does not fully resolve things for me. I am on RN 0.49.3, React 16.0.0-beta.5. PropTypes has been deprecated from React and moved to prop-types. This PR addresses some of this, but not completely. react-native-router-flux depends on an old version of react-navigation-experimental which also PropTypes from react. It needs to be get fixed there as well.

@daviscabral
Copy link
Collaborator Author

@ujwal-setlur #2541 address it - and also adds some performance improvements.

@ujwal-setlur
Copy link

ujwal-setlur commented Oct 24, 2017 via email

@daviscabral daviscabral deleted the dc-react-16-prop-types branch October 24, 2017 21:26
@schlaegerz
Copy link

Checked out your branch, it still doesn't completely work. It appears there are a few remaining propTypes declared incorrectly

@ghost
Copy link

ghost commented Dec 2, 2017

Hello,

Is this still a pending issue?

I've noticed my app is crashing in release mode but works fine in debug?

Thanks very much!

@ujwal-setlur
Copy link

I think it should be all fixed now

@daviscabral
Copy link
Collaborator Author

@MichaelStokes do you have more information about your issue? could you open a new issue with all the data from the template filled? tag me there please, so I can help you there.

@ghost
Copy link

ghost commented Dec 7, 2017

Hi @daviscabral

Thanks, I was able to address the issue by doing the following

https://stackoverflow.com/questions/47603791/react-native-undefined-is-not-an-object-evaluating-react2-proptypes-string/47603838#47603838

Using react-codemon, run on your projects directory

jscodeshift -t react-codemod/transforms/React-PropTypes-to-prop-types.js myapp/

This will resolve updating proptypes for your source code and any node modules.

Re-installing node modules will require running the command again it seems.

Please follow instructions over at https://github.com/reactjs/react-codemod but essentially once you've installed jscodeshift, and you've downloaded the react-codemod files as above for the various commands such as transforming React.propTypes to PropTypes and so on.

myapp/ here corresponds to my entire application project directory so the entire react-native project.

Secondly, consider the project dependencies you're using. For example in my case I was using react-native-router-flux at version 0.38.0, the app would work in debug mode, but crash in release. I attempted to upgrade to the latest beta version of 4.0.0-beta.24 and the problem was resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants