You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**If you try to use `connect` or `bindActionCreators` explicitly and want to type your component callback props as `() =>void` this will raise compiler errors. I happens because `bindActionCreators` typings will not map the return type of action creators to `void`, due to a current TypeScript limitations.**
512
512
513
513
A decent alternative I can recommend is to use `() =>any` type, it will work just fine in all possible scenarios and should not cause any typing problems whatsoever. All the code examples in the Guide with `connect` are also using this pattern.
@@ -134,7 +134,7 @@ Adds error handling using componentDidCatch to any component
134
134
135
135
## Redux Connected Components
136
136
137
-
### Caveat with `bindActionCreators`
137
+
### Caveat with `bindActionCreators`
138
138
**If you try to use `connect` or `bindActionCreators` explicitly and want to type your component callback props as `() =>void` this will raise compiler errors. I happens because `bindActionCreators` typings will not map the return type of action creators to `void`, due to a current TypeScript limitations.**
139
139
140
140
A decent alternative I can recommend is to use `() =>any` type, it will work just fine in all possible scenarios and should not cause any typing problems whatsoever. All the code examples in the Guide with `connect` are also using this pattern.
Copy file name to clipboardExpand all lines: docs/markdown/_intro.md
+3
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,9 @@
1
1
# React & Redux in TypeScript - Static Typing Guide
2
+
2
3
**_"This guide is about to teach you how to leverage [Type Inference](https://www.typescriptlang.org/docs/handbook/type-inference.html), [Generics](https://www.typescriptlang.org/docs/handbook/generics.html) and other [Advanced Types](https://www.typescriptlang.org/docs/handbook/advanced-types.html) as much as possible to write the minimal amount of type annotations needed for your JavaScript code to be completely Type Safe"_** - this will make sure you get all the benefits of Static Typing and your productivity won't be slowed down by adding excess type annotations.
3
4
5
+
[](https://gitter.im/react-redux-typescript-guide/Lobby)
6
+
4
7
> #### _Found it usefull? Want more updates?_[**Give it a :star2:**](https://github.com/piotrwitek/react-redux-typescript-patterns/stargazers)
0 commit comments