react-native-calendars
react-native-calendars copied to clipboard
TimelineList throws an error due to `key` prop being spread instead of explicitly passed
The error below is thrown when using TimelineList.
(NOBRIDGE) ERROR Warning: A props object containing a "key" prop is being spread into JSX:
let props = {key: someKey, format24h: ..., overlapEventsSpacing: ..., rightEdgeSpacing: ..., scrollToFirst: ..., scrollToNow: ..., date: ..., events: ..., initialTime: ..., scrollOffset: ..., onChangeOffset: ..., showNowIndicator: ..., numberOfDays: ..., timelineLeftInset: ...};
<Timeline {...props} />
React keys must be passed directly to JSX without using spread:
let props = {format24h: ..., overlapEventsSpacing: ..., rightEdgeSpacing: ..., scrollToFirst: ..., scrollToNow: ..., date: ..., events: ..., initialTime: ..., scrollOffset: ..., onChangeOffset: ..., showNowIndicator: ..., numberOfDays: ..., timelineLeftInset: ...};
<Timeline key={someKey} {...props} />
The key prop is defined in the _timelineProps and then spread into <Timeline {..._timelineProps} />
https://github.com/wix/react-native-calendars/blob/3a6183815232199befb675e280edd909bcc3a6fc/src/timeline-list/index.tsx#L124-L145
I am also seeing this warning.
Any solution to this issue?
+1 (wtf xd?)