Please review React code

Hi there! I’ve had some experience with React but I wonder if anything could be improved. So I’ve completed a random take-home task I found on Github. Please take a look at my code and chime in if you think anything should be done differently. Senior-grade devs are welcome to roast my code! Thanks in advance.

The task description
The completed task

Hello!

I assume this is a real application:
Did you sign an NDA for this take home assignment? Some companies have strict guidelines regarding assignments like this, yours might not be happy with sharing the link in public.

Best remove the link to their code and only show your solution if you are not sure to avoid legal trouble.

Best of luck getting the job!

Both links lead to public repos so no problem here. If you take a look at the assignment itself, it’s pretty basic and non-NDA-able I guess)

I missed the “random” in your original post, you should be fine. It’s even a great example for new students what to expect in a React take home interview.

From the first look at your file structure: Well done, looks professional with component, custom hook and a lib folders.

To give the repo an even more professional feel:

  • Add a utility/ utils folder for things like the modal in your components folder. This folder is for short, independent functions, used all over the application. The components folder is great for a more local scope, child components for example. Shows that you have scalability in mind.

  • Add a short description of your project in the top right corner of the repository, so people can instantly see what they are looking at. Plus write a README. Both don’t have to be long, but show that you care for documentation.

Thanks for your time!
Which part of modal component you think I should move to the utils folder? I think it looks good as it is, there’s a tiny bit of logic in there but it’s tied with the element ref, so I guess it’s where it should be? Am I missing something?

In this case it is in the right folder. I was referring to modals, toasts, popups etc without a special bond to an element that can be used all over the application.

I make them universally usable for a consistent UI appearance, unless they need a special, local styling or functionality.

Edit: Is your username a reference to Massive Attack? I have probably gathered thousands of hours listening to Mezzanine over the decades.

Yes, a terrific band, I hope they release something new one day )

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.