react-native-static-server
react-native-static-server copied to clipboard
Re-evaluate the possibility to use private methods (and `@babel/plugin-proposal-private-methods`) in the codebase again
Hi,
thank you for fixing this project!
How to reproduce this error: Just use FlatList and this project with the recommended plugin @babel/plugin-proposal-private-methods. Here are two issues from stackoverflow (FYI: I am not using Expo): https://stackoverflow.com/questions/69178384/react-native-typeerror-undefined-is-not-an-object-evaluating-props-getitem https://stackoverflow.com/questions/69922302/react-native-flatlist-undefined-is-not-an-object-evaluating-props-getitem
Is this a possible solution?
- make all private functions public by removing the hashtag prefix in
src/index.ts - remove @babel/plugin-proposal-private-methods
Ok, whatever, I just released v0.6.0-alpha.4 which gets rid of the private class features for now.
It turns out (https://github.com/facebook/react-native/issues/36828#issuecomment-1610324511) adding @babel/plugin-transform-flow-strip-types allows to avoid problems with <FlatList> when using private methods. Perhaps, with this in mind we can use them again.