Skip to main content

Reauseable props

We can make props be readable like this.

function ReuseableProps(custom={}){
return Object.assign(custom, {
title: "example title",
onClick: ()=>{
console.log("hello props!")
}
})
}

export default function App(){
return (
<Child1 {...ReuseableProps()}>
<Child2 {...ReuseableProps({value: "value props"})}>
)
}