-
Notifications
You must be signed in to change notification settings - Fork 3k
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
🐛 Bug Report: Error in react-native-calendars with ExpandableCalendar and Timeline #2586
Comments
bojarovski
changed the title
Here’s how you can structure your GitHub issue with proper formatting to describe the problem clearly: 🐛 Bug Report: Warning in react-native-calendars with ExpandableCalendar and Timeline
🐛 Bug Report: Warning in react-native-calendars with ExpandableCalendar and Timeline
Jan 13, 2025
bojarovski
changed the title
🐛 Bug Report: Warning in react-native-calendars with ExpandableCalendar and Timeline
🐛 Bug Report: Error in react-native-calendars with ExpandableCalendar and Timeline
Jan 13, 2025
+1 I'm seeing the same Warning. |
My patch-package patch index 372370c..ca97bb5 100644
--- a/node_modules/react-native-calendars/src/timeline-list/index.js
+++ b/node_modules/react-native-calendars/src/timeline-list/index.js
@@ -81,7 +81,7 @@ const TimelineList = (props) => {
return renderItem(_timelineProps, { item, index, isCurrent, isInitialPage, isToday: _isToday });
}
return (<>
- <Timeline {..._timelineProps}/>
+ <Timeline {..._timelineProps} key={_timelineProps.key}/>
{/* NOTE: Keeping this for easy debugging */}
{/* <Text style={{position: 'absolute'}}>{item}</Text>*/}
</>);
diff --git a/node_modules/react-native-calendars/src/timeline/Timeline.js b/node_modules/react-native-calendars/src/timeline/Timeline.js
index 8eae6ce..121dca6 100644
--- a/node_modules/react-native-calendars/src/timeline/Timeline.js
+++ b/node_modules/react-native-calendars/src/timeline/Timeline.js
@@ -91,7 +91,7 @@ const Timeline = (props) => {
};
return (<ScrollView
// @ts-expect-error
- ref={scrollView} style={styles.current.container} contentContainerStyle={[styles.current.contentStyle, { width: constants.screenWidth }]} showsVerticalScrollIndicator={false} {...scrollEvents} testID={testID}>
+ key={date} ref={scrollView} style={styles.current.container} contentContainerStyle={[styles.current.contentStyle, { width: constants.screenWidth }]} showsVerticalScrollIndicator={false} {...scrollEvents} testID={testID}>
<TimelineHours start={start} end={end} date={pageDates[0]} format24h={format24h} styles={styles.current} unavailableHours={unavailableHours} unavailableHoursColor={unavailableHoursColor} onBackgroundLongPress={onBackgroundLongPress} onBackgroundLongPressOut={onBackgroundLongPressOut} width={width} numberOfDays={numberOfDays} timelineLeftInset={timelineLeftInset} testID={`${testID}.hours`}/>
{times(numberOfDays, renderTimelineDay)}
</ScrollView>);``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
When using the
ExpandableCalendar
andTimelineList
components fromreact-native-calendars
, the following warnings are displayed:Error 1
Error 2
Steps to Reproduce
ExpandableCalendar
andTimelineList
components as shown in the code below:Expected Behavior
No warnings should appear for proper usage of
ExpandableCalendar
andTimeline
.Observed Behavior
props
containing akey
prop.defaultProps
inExpandableCalendar
.Environment
react-native-calendars
(e.g.,1.1307.0
)18.3.1
0.76.5
The text was updated successfully, but these errors were encountered: