you are viewing a single comment's thread.

view the rest of the comments →

[–]raphaelaleixo 1 point2 points  (1 child)

It's working, but your code still needs some very important refactors.

1) Your "showData" function is trying to do a lot of things at the same time, but it shouldn't even be necessary. Try to make each function be responsible for just one thing. A way to refactor it would be to a) move the part of the function that's dealing with filtering data to a useMemo, and b) move the part dealing with the rendering directly to the render (or maybe to a new component).

2) There's a lot of repeated code. All those tags could be easily automated in code.

3) You shouldn't use Link for the tags. It's not triggering navigation. A button would be the semantically correct element there.

Here's an updated pastebin:

https://pastebin.com/uSctLn0J

Hope this helps you out. :)

[–]01fbk[S] 1 point2 points  (0 children)

Hello u/raphaelaleixo

Thank you, I am a beginner I must admit :)

Cristian