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

Referencing propTypes at runtime causes inconsistent behavior when using babel-plugin-transform-react-remove-prop-types plugin #3020

Closed
tylerdavis opened this issue Sep 14, 2019 · 1 comment

Comments

@tylerdavis
Copy link

Do you want to request a feature or report a bug?

bug

What's the current behavior?

In a recent pull request #2855, a change was introduced that references Content.propTypes at runtime.

The default babel configuration for rails uses a plugin that strips the definition of propTypes out of all files for production compilation. Referencing propTypes at runtime feels like an anti-pattern which should probably be avoided, since in most cases prop-types is generally considered a dev tool and configured as a dev dependency.

The offending line is https://github.com/ianstormtaylor/slate/blob/master/packages/slate-react/src/components/content.js#L542

@ianstormtaylor ianstormtaylor mentioned this issue Nov 6, 2019
@ianstormtaylor
Copy link
Owner

Fixed by #3093.

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 a pull request may close this issue.

2 participants