5 ms·
Just wanted to say thanks for Redux Toolkit and the hooks API - they were truly the key features in making me consider it a solid benefit with TypeScript integr
by arsome 5y ago
Just wanted to say thanks for Redux Toolkit and the hooks API - they were truly the key features in making me consider it a solid benefit with TypeScript integration in mind and getting the interest of colleagues who were less familiar with the ecosystem.
- acemarke 5y agoGlad those are working well for you! Yeah, one of the reasons we recommend the hooks API as the default _is_ because it's so much easier to use with TS. It's _possible_ to use `connect` with TS, but the typing overloads are a complete pain to work with. Fortunately, `useSelector` is just a simple function call, and `useDispatch` just gives you the `dispatch` method itself. Less abstraction, easier to type correctly, and easier to use.