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

Re-evaluate the possibility to use private methods (and @babel/plugin-proposal-private-methods) in the codebase again #9

Open
NqCompiler opened this issue Sep 4, 2022 · 2 comments
Labels
On Hold Cannot be resolved at the moment. P4 No action needed at this time.

Comments

@NqCompiler
Copy link

NqCompiler commented Sep 4, 2022

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?

  1. make all private functions public by removing the hashtag prefix in src/index.ts
  2. remove @babel/plugin-proposal-private-methods
@birdofpreyru
Copy link
Owner

Ok, whatever, I just released v0.6.0-alpha.4 which gets rid of the private class features for now.

@birdofpreyru
Copy link
Owner

It turns out (facebook/react-native#36828 (comment)) 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.

@birdofpreyru birdofpreyru reopened this Oct 4, 2023
@birdofpreyru birdofpreyru changed the title React Native TypeError: undefined is not an object (evaluating 'props.getItem') Re-evaluate the possibility to use private methods (and @babel/plugin-proposal-private-methods) in the codebase again Oct 4, 2023
@birdofpreyru birdofpreyru added P4 No action needed at this time. On Hold Cannot be resolved at the moment. labels Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
On Hold Cannot be resolved at the moment. P4 No action needed at this time.
Projects
None yet
Development

No branches or pull requests

2 participants