Skip to content
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

React complaining on missing unike key in array of element #181

Open
galop1n opened this issue Sep 23, 2022 · 1 comment
Open

React complaining on missing unike key in array of element #181

galop1n opened this issue Sep 23, 2022 · 1 comment

Comments

@galop1n
Copy link

galop1n commented Sep 23, 2022

Hi, I am on react-range 1.8.14 and I keep getting the warning on missing unique key from the JSX validation. The warning is emit by rendering children within the renderTrack callback.

My workaround has been to alter the children with {React.Children.toArray(children)} but a proper fix would be appreciated.

I i am doing something stupid, also possible, I am open to advice.

@jandolezal71
Copy link

I just put key from props in my custom thumb component

renderThumb={(props) => (
   <Thumb
    {...props}
    key={props.props.key}
    range={rangeRef.current}
    step={step}
    values={values}
  />
)}

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

No branches or pull requests

2 participants