IMHO, its just matter of simplicity and consistency.
<Child setText={ setText }>
// is the same as
<Child setText={(text) => { setText(text) }}>
// but not as
<Child setText={ setText() }>
//or
<Child setText={(text) => setText(text)}>
I just saw a video on callbacks that made it clear for me.. I will find it again to grab a link and share if anyone needs...But what's the difference between 2nd format and the 4th one that you have shared?
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
IMHO, its just matter of simplicity and consistency.
CMIIW.
I just saw a video on callbacks that made it clear for me.. I will find it again to grab a link and share if anyone needs...But what's the difference between 2nd format and the 4th one that you have shared?