react-native-calendars: ExpandableCalendar error under React native 0.74
today i upgraded my app to react native 0.74 and i got the following error:
ERROR Warning: ExpandableCalendar: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
This warning message indicates that your code is using a deprecated way of setting default values for props in React functional components
### Tasks
### Tasks
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 10
- Comments: 26
@zkteco-home , same error message, so the error is in defaultProps in ExpandableCalendar? since there is no new commit, how to avoid the error message locally? thanks!
As @debugtheworldbot suggested a simple temporary fix. I would also recommend the same fix until devs patch the issues with an update. Till then this is the fix:
ExpandableCalendar.defaultProps = undefined;For TypeScript:
(ExpandableCalendar as any).defaultProps = undefined;This should temporarily fix the issues till a patch or an update arrives.
Maybe someone doesn’t want add a patch for this. I just add a simple temporary fix to avoid this warning:
PR open https://github.com/wix/react-native-calendars/pull/2480