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 spread operator is still in the official documentation #11293

Closed
salehhamadeh opened this issue Oct 19, 2017 · 4 comments
Closed

React spread operator is still in the official documentation #11293

salehhamadeh opened this issue Oct 19, 2017 · 4 comments

Comments

@salehhamadeh
Copy link

salehhamadeh commented Oct 19, 2017

Bug in documentation

What is the current behavior?
React's spread operator was removed in React 16, but it is still in the documentation https://reactjs.org/docs/jsx-in-depth.html#spread-attributes

What is the expected behavior?
A word of caution should be included that this does not include React 16+. Maybe also add other ways of spreading props.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
React 16+. It worked in previous releases.

@gaearon
Copy link
Collaborator

gaearon commented Oct 20, 2017

Spread operator is a language feature, it was not (and could not) be removed in React 16.

What are your referring to?

@aweary
Copy link
Contributor

aweary commented Oct 20, 2017

@salehhamadeh you may be thinking of React.__spread which was removed in #8942. As @gaearon pointed out, the spread operator is an entirely different thing. I hope that clears things up.

@aweary aweary closed this as completed Oct 20, 2017
@salehhamadeh
Copy link
Author

I figured out what is happening. My code used JSXTransformer, which compiled the spread attribute to React.__spread. Thanks for helping me figure it out.

@gaearon
Copy link
Collaborator

gaearon commented Oct 20, 2017

Oh I see. Yeah, JSXTransformer might have broken since then. But also note that it has been unsupported for about two years now. And you should not be using it in production (if you did)—instead, please compile JSX with Babel ahead of time.

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

3 participants