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

Throws warning with key and refs when passing {...props} #6450

Closed
KrisCoulson opened this issue Apr 8, 2016 · 5 comments
Closed

Throws warning with key and refs when passing {...props} #6450

KrisCoulson opened this issue Apr 8, 2016 · 5 comments

Comments

@KrisCoulson
Copy link

facebook/react/pull/5744

It seems with the newest update v15 when passing props into a child component with the spread operator the console throws the warnings associated with this pull request.

seems to only throw issue when the component is not a class but only stateless component hence passing just {...props} and not {...this.props}

image

I am not accessing refs or keys in the child component

@CaptainN
Copy link

I have a similar issue when cloning children to add props:

{React.Children.map (props.children, (child) => {
  return React.cloneElement (child, props)
})}

@jimfb
Copy link
Contributor

jimfb commented Apr 15, 2016

This is almost a duplicate of #6268, the relevant discussion is there.

@dlong500
Copy link

I'm also running into this when using cloneElement. The code accessing refs and keys is definitely in that function (not in my code). I've read through #6268 but can't tell if that PR specifically solves this particular issue with cloneElement.

@xile611
Copy link

xile611 commented May 25, 2016

Same problem when using cloneElement.

@gaearon
Copy link
Collaborator

gaearon commented Oct 3, 2017

I believe this was fixed in #6880.

@gaearon gaearon closed this as completed Oct 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants