Created
October 12, 2022 16:28
-
-
Save DoctorDerek/31f212e4e14a102a3978a0beb9b73f5b to your computer and use it in GitHub Desktop.
Partial Object Destructuring of React Props With ... Rest Parameters Syntax https://medium.com/p/4e8629a02035
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const CardComponent = ({ name, ...props }) => <div>name</div> | |
// That format is equivalent to including the following code: | |
const { name } = props | |
// As in the above example, there could be other stuff in props. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment