babel-plugin-transform-react-remove-prop-types
babel-plugin-transform-react-remove-prop-types copied to clipboard
Doesn't work with react-navigation library
Hi @oliviertassinari ! Thank you for such a great plugin! It makes our app much more performant in production.
Unfortunately, it doesn't work with latest version of react-navigation library or maybe library doesn't work with your plugin. I am not sure on what side the issue is.
Once you add babel-plugin-transform-react-remove-prop-types plugin in the project, which uses react-navigation code, the build fails with error TypeError: undefined is not an object (evaluating '_getPrototypeOf2.default').

But react-navigation doesn't have any prop-types in its code and the real problem is that their source code is already compiled with Babel to something like this
They use bob package for building their sources https://github.com/react-native-community/bob
Adding react-navigation to ignoreFilenames config option doesn't help.
react-navigation is a very popular library and it is often used with Expo framework. Can you investigate what is wrong and where?
Here is the test repo where you can test the bug https://github.com/serhiipalash/test-transform-react-remove-prop-types/commits/master . If you don't have phone simulator installed on your pc, you can do
npm install -g expo-cli
expo start --tunnel
and open the project on your real device by screenshoting QR-code, displayed in Terminal, with Expo mobile app