react-native-indicators icon indicating copy to clipboard operation
react-native-indicators copied to clipboard

Bug: React keys must be passed directly to JSX in MaterialIndicator

Open Haco11 opened this issue 1 year ago • 7 comments

Hi! 👋

Thank you for your work on this project! 😊

I encountered a React warning when using MaterialIndicator from [email protected]:

Warning: A props object containing a "key" prop is being spread into JSX: <Animated(View) {...props} /> React keys must be passed directly to JSX without using spread: <Animated(View) key={someKey} {...props} />

Proposed Fix Pass the key prop directly to Animated.View. Here's the diff:

<Animated.View style={styles.layer} {...{ key: index }}>

  • <Animated.View style={styles.layer} key={index}> This resolves the issue without changing component behavior.

Thank you for reviewing! Let me know if more details are needed. 😊

Haco11 avatar Nov 16 '24 21:11 Haco11