Open david-mi opened 5 months ago
On ExpandableCalendar component, when screenReaderEnabled state is set to true, it causes a "rendered fewer Hooks than expected" error
ExpandableCalendar
screenReaderEnabled
true
https://github.com/wix/react-native-calendars/blob/da9b1bd702e1221002d6e30aaf888e350b627b6a/src/expandableCalendar/index.tsx#L128
Based on this part of react documentation : Never call component functions directly
This error is occuring because some components are called as regular functions instead of JSX :
https://github.com/wix/react-native-calendars/blob/da9b1bd702e1221002d6e30aaf888e350b627b6a/src/expandableCalendar/index.tsx#L610-L617
My fix involves few changes by simply converting render functions name to Pascal case, and then calling them as JSX
The issue
On
ExpandableCalendar
component, whenscreenReaderEnabled
state is set totrue
, it causes a "rendered fewer Hooks than expected" errorhttps://github.com/wix/react-native-calendars/blob/da9b1bd702e1221002d6e30aaf888e350b627b6a/src/expandableCalendar/index.tsx#L128
Demo
Analysis
Based on this part of react documentation : Never call component functions directly
This error is occuring because some components are called as regular functions instead of JSX :
https://github.com/wix/react-native-calendars/blob/da9b1bd702e1221002d6e30aaf888e350b627b6a/src/expandableCalendar/index.tsx#L610-L617
Suggested Fix
My fix involves few changes by simply converting render functions name to Pascal case, and then calling them as JSX
Demo