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

Warning: BigListItem: Support for defaultProps will be removed from function components in a future major release. Please switch to JavaScript default parameters #365

Open
meltemhuseynov opened this issue Oct 8, 2024 · 2 comments

Comments

@meltemhuseynov
Copy link

I'm encountering a deprecation warning when using the BigList component in my React Native project. The warning states that support for defaultProps in function components will be removed in a future major release of React.

@Fyb3roptik
Copy link

Same here

@musasoftlabx
Copy link

Default props and prop types were depreciated in react 18. I tried suppressing it in LogBox but no success.

image

Of course the library has to be updated but if u would like a simple solution, In your project, go to

/node_modules/react-native-big-list/dist/commonjs/BigListItem.js

Line 58, safely remove the line below since the default prop width is already declared above on line 41

BigListItem.defaultProps = {
  width: "100%"
};

The error should go away.

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

No branches or pull requests

3 participants