DEV Community

Discussion on: the correct way to fetch data with react hooks

Collapse
 
amn3s1a2018 profile image
Amn3s1a2018

Has any drawbacks writing like:
‘const setPartData = (partialData) => setData(prevState => ({ ... prevState, ...partialData }));‘
It can prevent weird behaviors in more complex environments.