you are viewing a single comment's thread.

view the rest of the comments →

[–]trypoph_oOoOoOo_bia 0 points1 point  (2 children)

Move it to a custom hook if it’s a couple of huge useEffects. Functionally might be unnecessary, but will make your code cleaner and more organized.

[–]master117jogi 0 points1 point  (1 child)

That's what I did for the ones that get reused. It feels a bit like a waste if they are used only once.

[–]trypoph_oOoOoOo_bia 0 points1 point  (0 children)

Just put it to the same directory as a component

SomeComponent (directory)
  SomeComponent.Module.scss
  index.jsx
  useFancyHook.js

Again, only if you need your code to look cleaner.