react-book icon indicating copy to clipboard operation
react-book copied to clipboard

[4.3 - pap/components/Notes.jsx] -"onDelete... dummy callback" question

Open JESii opened this issue 7 years ago • 1 comments

After you update Notes.jsx with the delete functionality, you say:

"I defined a dummy callback for it [onDelete]."

I believe this is referring to the line: export default ({notes, onDelete=() => {}})

This is probably picking nits, but the way I see it, there's actually no callback function defined, dummy or otherwise -- what I would call this is just defining an empty function so that onDelete is defined (i.e., not null), even if it is not provided by the caller.

JESii avatar May 16 '17 15:05 JESii

Technically it will trigger onDelete even if it's provided an empty function. I might have to rethink the section to eliminate the function. Thanks for bringing this up.

bebraw avatar May 16 '17 15:05 bebraw