[Not loaded yet]
a good component doesn’t mind being re-rendered more often — or less often. it doesn’t assume anything about when the renders happen.
you can add a prop that changes every second, and it’ll still work.
it doesn’t assume a re-render always leads to a change — and trusts the code above to optimize
Oct 23, 2024 11:10a good component is always reactive to its props. it doesn’t assume that its props will stay the same. the result of rendering a component with props changing from A to B to C should usually be the same as if it was rendered with C to begin with. a good component doesn’t obstruct the data flow.
a good component often hides a bit of state. it doesn’t burden unrelated components with state they shouldn’t know or care about.
a good component only contains the minimal necessary state it needs. it doesn’t hold things in state if they can be calculated on the fly from existing information.