-
Notifications
You must be signed in to change notification settings - Fork 61
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
propTypes not removed for HOC #106
Comments
I would need the full source code of your examples. CASE 1 and CASE 2 are expected from the source code you are sharing. For CASE 3, you could try the removeImport option. |
@oliviertassinari thanks for the quick reply! Notice that your plugin is not in that branch yet cause I'm still experimenting with it right now. |
Concerning CASE 3, I've tried multiple times in my babel config:
but it seems to have no effect. The import is never removed. |
Also this won't work:
|
Here is a simplified failing case to illustrate #108. |
Hello,
I've just installed this and it seems that for my edge cases this is not working.
The following propTypes are not removed from the build. While all the others declared in the standard way are correctly removed.
CASE 1:
CASE 2:
Here I used wrappedComponents, because I'm decorating my original component
MyComp
with mobx-react @observer that will indeed create a new wrapper. So the original component is available asMyComp.wrappedComponent
.CASE 3:
This applies to both cases above.
I'm importing my PropTypes from the new separate packages
It seems the import is never removed from the build using the default config (supposed to be
remove
mode).I'm not sure if this is due to the 2 cases above (still having some
propTypes
in the build would not allow to remove the import?) or because I import them from the separate package and not from the React core... 🤔The text was updated successfully, but these errors were encountered: