|
|
|
|
|
by tomhallett
4547 days ago
|
|
I've been using React for a few months - it definitely does make for code which is easy to reuse and reason about. The part of the architecture which has had the biggest impact on my code: the relationship between a component and it's subcomponents. A parent component can only pass "props" to it's subcomponents (ie it can't pass state, which is easily mutable). And a child component can only call a function on it's parent if that function is provided to it via props (ie a callback). This design has forced me to reason about the interface between components (open/closed principle, law of demeter, etc) and has really improved my code. Also, the team is very active/helpful in their irc room. |
|