Redux-connected React components in TypeScript

by Marcel Veldhuizen 5. May 2017 14:04

When I originally started using React together with TypeScript, I felt it was a great marriage of technologies. However, adding Redux into the mix (which is awesome, BTW) has created a lot of complexity to properly type my React Components. Type inference doesn't appear to work smoothly for the connect method in React Redux.

For simple stateless components, there is a pretty good solution by Silvio J. Gutierrez, which is pretty similar to something I had been using.

I've tried to come up with a good solution for more complex components as well. This is the best I've managed so far:

More...

Tags: , ,

Web Development

Marcel Veldhuizen

Software Architect by profession, mostly focused on Microsoft .NET technology.

Metal enthusiast; I love going to concerts :)

 

RecentPosts

Recent Tweets

Note: For Customization and Configuration, CheckOut Recent Tweets Documentation