Skip to content

Conversation

ionkorol
Copy link

Problem
When using the TimelineList component the error bellow is logged.

A props object containing a "key" prop is being spread into JSX:
  let props = %s;
  <%s {...props} />
React keys must be passed directly to JSX without using spread:
  let props = %s;
  <%s key={someKey} {...props} /> {key: someKey, onEventPress: ..., format24h: ..., date: ..., events: ..., scrollToNow: ..., initialTime: ..., scrollToFirst: ..., scrollOffset: ..., onChangeOffset: ..., showNowIndicator: ..., numberOfDays: ..., timelineLeftInset: ...} Timeline {onEventPress: ..., format24h: ..., date: ..., events: ..., scrollToNow: ..., initialTime: ..., scrollToFirst: ..., scrollOffset: ..., onChangeOffset: ..., showNowIndicator: ..., numberOfDays: ..., timelineLeftInset: ...} Timeline

Solution
Set the key prop explicitly and not rely on the props spread which breaks the rules of react.

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

Successfully merging this pull request may close these issues.

1 participant