# Please review React code

**URL:** <https://forum.freecodecamp.org/t/please-review-react-code/680153>\
**Category:** I Built This\
**Created:** [March 17, 2024, 12:17pm UTC](https://forum.freecodecamp.org/t/please-review-react-code/680153 "2024-03-17T12:17:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![massive-attach](https://avatars.discourse-cdn.com/v4/letter/m/9fc29f/32.png) [@massive-attach](https://forum.freecodecamp.org/u/massive-attach)\
**Post date:** [March 17, 2024, 12:17pm UTC](https://forum.freecodecamp.org/t/please-review-react-code/680153/1 "2024-03-17T12:17:28Z")

</div>

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](https://github.com/dailypay/react-take-home-test)  
[The completed task](https://github.com/massive-attach/react-take-home-ass)

---

<div class="post-metadata">

**Author:** ![DanielHuebschmann](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/danielhuebschmann/32/415871_2.png) [@DanielHuebschmann](https://forum.freecodecamp.org/u/DanielHuebschmann)\
**Post date:** [March 18, 2024, 9:32am UTC](https://forum.freecodecamp.org/t/please-review-react-code/680153/2 "2024-03-18T09:32:40Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![massive-attach](https://avatars.discourse-cdn.com/v4/letter/m/9fc29f/32.png) [@massive-attach](https://forum.freecodecamp.org/u/massive-attach)\
**Post date:** [March 18, 2024, 12:17pm UTC](https://forum.freecodecamp.org/t/please-review-react-code/680153/3 "2024-03-18T12:17:21Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![DanielHuebschmann](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/danielhuebschmann/32/415871_2.png) [@DanielHuebschmann](https://forum.freecodecamp.org/u/DanielHuebschmann)\
**Post date:** [March 18, 2024, 1:22pm UTC](https://forum.freecodecamp.org/t/please-review-react-code/680153/4 "2024-03-18T13:22:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![massive-attach](https://avatars.discourse-cdn.com/v4/letter/m/9fc29f/32.png) [@massive-attach](https://forum.freecodecamp.org/u/massive-attach)\
**Post date:** [March 19, 2024, 4:58am UTC](https://forum.freecodecamp.org/t/please-review-react-code/680153/5 "2024-03-19T04:58:09Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![DanielHuebschmann](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/danielhuebschmann/32/415871_2.png) [@DanielHuebschmann](https://forum.freecodecamp.org/u/DanielHuebschmann)\
**Post date:** [March 19, 2024, 7:25am UTC](https://forum.freecodecamp.org/t/please-review-react-code/680153/6 "2024-03-19T07:25:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![massive-attach](https://avatars.discourse-cdn.com/v4/letter/m/9fc29f/32.png) [@massive-attach](https://forum.freecodecamp.org/u/massive-attach)\
**Post date:** [March 19, 2024, 8:35am UTC](https://forum.freecodecamp.org/t/please-review-react-code/680153/7 "2024-03-19T08:35:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [September 17, 2024, 8:35pm UTC](https://forum.freecodecamp.org/t/please-review-react-code/680153/8 "2024-09-17T20:35:51Z")

</div>

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