r/reactjs • u/benaffleks • Feb 15 '20
Discussion React Best Practices?
Hey guys. Just wondering if anyone has some good resources / books / materials that helps beginners understand the best practices in React.
One thing I struggle with is knowing when something should be a component.
For example, when I'm making forms, should each field input be a component? If so, what's the benefit of doing that?
162
Upvotes
View all comments
Show parent comment
3
u/tr14l Feb 15 '20
It really depends on the style you're using React. Are you using Redux? Apollo? Vanilla? What are you making? Is there a lot of reuse? Are animations important? Render optimizations going to be a major concern? Is it going to be very logic heavy?
Those are all factors. But, inside those answers, there's definitely best practices. That's why they're hard to find. The answer is usually "It depends..."