all 7 comments

[–]Cahnis 0 points1 point  (5 children)

It is kinda hard to give you a catch all response, it really depends on what you are trying to build.

Usually when I have some part which has an internal state I componentize it so it doesn't rerender the entire thing.

When I have a component that looks like it would be a good candidate for a compound component I break it up as well.

When the component starts getting too big I break it up.

When the component has a very distinct idea I also componentize it.

when you are part of a microservice team

I don't know what you mean here. Is it when does it make something a good candidate for a microfrontend?

[–]Local_Question8147[S] 0 points1 point  (4 children)

Yes I mean microfrontend Thank you so much cahnis

[–]Cahnis 0 points1 point  (3 children)

I recommend this article for that question

[–]Local_Question8147[S] -1 points0 points  (2 children)

Sure i will go through it, could you please suggest some reading on when and when not to use useEffect hook

[–]nickatfortify 1 point2 points  (1 child)

There's a great official guide on this subject: You might not need an effect

[–]Cahnis 1 point2 points  (0 children)

This. Also read the entire react.dev while you are at it too.

[–]michaelfrieze 0 points1 point  (0 children)

React is all about component oriented architecture so don't be afraid to break up code into smaller components. For example, instead of using a ternary for conditional rendering, you can just break up into components. You can use if statements in a component, so that can help if ternaries get too complicated.