I\'m kind of new to reactjs and I\'m trying to do a bit of clean up. I was wondering how I could use spread attributes for props provided by the new context api?
Since both the components need to be passed the same props, you can create an object and then pass it to the components using spread syntax like
{(val) => {
const customProps = {
results: val.results,
loading: val.loading,
viewTicket: val.viewTicket,
formatStatus: val.formatStatus,
fetchData: val.fetchData,
formatDate: val.formatDate,
sortResults: val.sortResults,
formatTitle: val.formatTitle
}
return
}/>
}/>
}}