DEV Community

Discussion on: Can you help me with some feedback on my react practice code, please?

emma profile image
Emma Goto 🍙

It's hard to know the exact reasons why - I think a good first step is to have Eslint set up so that your code is styled nicely. If you look inside of PhotoGallery.jsx some of the lines of code in there are really long.

Other things I noticed in that file:

  • You had some inline onlicks - onClick={e => {e.stopPropagation(); handleDelete(}} I think would have been better to extract these into proper functions like you did for other things
  • You had a <h1 title={p.title}>{p.title}</h1> - not sure if that's a Tailwind thing, but do you. need to be passing it in more than once?

In Modal.jsx:

  • Both of your usages of ModalPop passed in the same null argument, maybe you could have skipped passing it in if it's always going to be null. And rename it to onCloseModal

I think adding some unit tests also goes a long way.

send2moran profile image
Moran Helman Author

amazing ! thank you for the feedback❤️