4 ms·
You can define components as simple functions and avoid passing things down through attributes. If you use TypeScript with it, the compiler will always make sur
by elbear 8y ago
You can define components as simple functions and avoid passing things down through attributes. If you use TypeScript with it, the compiler will always make sure you pass the right arguments to the component, so it's very easy to compose your UI.
I also avoid keeping state on components. I know this is controversial and it requires a bit of overheard. However, the simplicity offered by having all state in a single object is worth it for me.