Your solution is perfectly fine.
Tim Scott
1

Hi Tim — That suggestion doesn’t work because deleteUser will receive an event, not the user. Set a debugger in deleteUser and you’ll see what I mean.

That said, I agree that extracting to a child function when mapping is my preference as well for other reasons. For example, you can often declare the child as a pureComponent to avoid unnecessary renders.

Like what you read? Give Cory House a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.