Skip to content

Commit fb3f71b

Browse files
committed
connect: Add a "fixme" version, connectFlowFixMe.
1 parent cf7ada9 commit fb3f71b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/react-redux.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,19 @@ export const connect: <
1414
>(
1515
mapStateToProps?: (GlobalState, SP) => RSP,
1616
) => C => ComponentType<CP & SP> = mapStateToProps => connectInner(mapStateToProps);
17+
18+
/**
19+
* DEPRECATED. Don't add new uses; and PRs to remove existing uses are welcome.
20+
*
21+
* This is exactly like `connect` except with type-checking disabled.
22+
* Any place we use it, it's because there's a type error there.
23+
* To fix: change the call site to use `connect`; see what error Flow
24+
* reports; and fix the error.
25+
*
26+
* (Backstory: for a long time `connect` had a type that partly defeated
27+
* type-checking, so we accumulated a number of type errors that that hid.
28+
* This untyped version lets us fix those errors one by one, while using the
29+
* new, well-typed `connect` everywhere else.)
30+
*/
31+
export const connectFlowFixMe = (mapStateToProps: $FlowFixMe) => (c: $FlowFixMe) =>
32+
connect(mapStateToProps)(c);

0 commit comments

Comments
 (0)