Skip to content

Missing docs about Transferring Props in JSX #109

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

Closed
hellobrian opened this issue Oct 10, 2017 · 3 comments · Fixed by #121
Closed

Missing docs about Transferring Props in JSX #109

hellobrian opened this issue Oct 10, 2017 · 3 comments · Fixed by #121

Comments

@hellobrian
Copy link
Contributor

hellobrian commented Oct 10, 2017

(Originally opened in facebook/react#11124 (comment))

I noticed that the latest docs don't talk about Transferring Props in JSX with rest properties.

/* for example */
render() {
  const { children, ...other } = this.props;
  return <button {...other}>{children}</button>
}

☝️ I felt that this was really useful for building reusable react components and an important concept to surface on the main docs. I was curious if omitting this documentation was intentional? If so, it would be great to understand why (maybe this isn't a good practice anymore?).

Otherwise, I would be happy to send a PR that adds this back into the docs with any changes you and the community want to see. Overall, I just think this is important info to surface in the current docs.

Thanks!

@bvaughn
Copy link
Contributor

bvaughn commented Oct 10, 2017

On the JSX in Depth section of the docs there's a header called Spread Attributes. It isn't exactly what you mention though since it doesn't show how you can pluck some properties out and pass through the rest.

Would you be interested in submitting a PR that adds an additional example to this section?

@hellobrian
Copy link
Contributor Author

Yes, I can send a PR - thanks for the quick response!

@bvaughn
Copy link
Contributor

bvaughn commented Oct 10, 2017

This issue is all yours! 😄

I've added an "in-progress" label so that others will know not to start work on the issue. If you change your mind about the issue, no worries! Just let me know so that I can remove the label and free it up for someone else to claim.

Cheers!

jhonmike pushed a commit to jhonmike/reactjs.org that referenced this issue Jul 1, 2020
* Translate Glossary

* Add Universal Style Guide to glossary as suggested
jhonmike pushed a commit to jhonmike/reactjs.org that referenced this issue Jul 1, 2020
* Add Universal Style Guide tranalation

* [WIP] Translate Glossary (reactjs#109)

* Translate Glossary

* Add Universal Style Guide to glossary as suggested

* Add Universal Style Guide tranalation

* Little fix

* Fix merge issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment