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

Bug when using rr with babel-plugin-transform-remove-prop-types #4493

Closed
quantizor opened this issue Feb 9, 2017 · 3 comments
Closed

Bug when using rr with babel-plugin-transform-remove-prop-types #4493

quantizor opened this issue Feb 9, 2017 · 3 comments

Comments

@quantizor
Copy link

quantizor commented Feb 9, 2017

Due to this line: https://github.com/ReactTraining/react-router/blob/389df9c0ba603b758de4a979a34ee10276f9a8d0/modules/Router.js#L135

I got around this in another library I maintain by requiring that defaultProps be set for each propType and then doing what you're doing with defaultProps instead.

quantizor pushed a commit to enigma-io/boundless that referenced this issue Feb 9, 2017
@timdorr timdorr added the v3 label Feb 9, 2017
@timdorr
Copy link
Member

timdorr commented Feb 9, 2017

What error are you getting? That the propTypes don't exist or aren't an object?

Honestly, I'm not sure if this is our responsibility though. That plugin isn't super-common to be used and is something outside of this library that's interfering. Also, it isn't supposed to run on node_modules, just your own code.

@quantizor
Copy link
Author

quantizor commented Feb 9, 2017

That's a good point @timdorr, I raised an issue against the plugin: oliviertassinari/babel-plugin-transform-react-remove-prop-types#82

To answer your question, I'm getting "cannot call Object.keys on undefined", since the propTypes are getting stripped from the Router class definition.

@timdorr
Copy link
Member

timdorr commented Feb 9, 2017

Looks like this is more on bptrrpt (™!) to provide some sort of fix for. I'm happy to add in some small guard comments or some other indicator that it should ignore that line of code, but this isn't a "React Router problem" per se. So, closing this one out. Thanks for bringing it up, @yaycmyk!

@timdorr timdorr closed this as completed Feb 9, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants