diff --git a/content/docs/jsx-in-depth.md b/content/docs/jsx-in-depth.md index fafbe64d..9837958d 100644 --- a/content/docs/jsx-in-depth.md +++ b/content/docs/jsx-in-depth.md @@ -245,7 +245,30 @@ function App2() { } ``` -Spread attributes can be useful when you are building generic containers. However, they can also make your code messy by making it easy to pass a lot of irrelevant props to components that don't care about them. We recommend that you use this syntax sparingly. +You can also pick specific props that your component will consume while passing all other props using the spread operator. + +```js{2} +const Button = props => { + const { kind, ...other } = props; + const className = kind === "primary" ? "PrimaryButton" : "SecondaryButton"; + return ; +}; + +const App = () => { + return ( +