spreading object as props

Solutions on MaxInterview for spreading object as props by the best coders in the world

showing results for - "spreading object as props"
Aarón
18 Jan 2019
1// These two are equivalentfunction App1() {  return <Greeting firstName="Ben" lastName="Hector" />;}function App2() {  const props = {firstName: 'Ben', lastName: 'Hector'};  return <Greeting {...props} />;}