react props spread code example
Example: spreading object as props
// These two are equivalentfunction App1() { return <Greeting firstName="Ben" lastName="Hector" />;}function App2() { const props = {firstName: 'Ben', lastName: 'Hector'}; return <Greeting {...props} />;}