4 ms·
Definitely. I started writing React/Typescript this way, and it's been a pleasure. Each component is just a function, so composing components is just a data pip
by mind-blight 7y ago
Definitely. I started writing React/Typescript this way, and it's been a pleasure. Each component is just a function, so composing components is just a data pipeline. If you have few, key data structures that you're working with, it makes reconfiguring that pipeline to fit product needs a while lot easier.
It also means you naturally end up with small, testable, generic components without having to think too hard about it. You've five the heavy lifting in the data structure, and whatever behavior you want flows naturally from that.