In generally, we need pass all props like this.
const Baz = (props) => {
const {a, b, c} = props
return <>
<div>{a}</div>
<Foo {...props} />
<Bar b={b} />
</>
}
But we can omit props
with spread operator and shorthand property name.
const Baz = ({a, b, c}) => {
return <>
<div>{a}</div>
<Foo {...{a, b, c}} />
<Bar b={b} />
</>
}
Top comments (0)