File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,14 @@ import { isValidElementType } from 'react-is'
5
5
6
6
import { ReactReduxContext } from './Context'
7
7
8
+ const stringifyComponent = Comp => {
9
+ try {
10
+ return JSON . stringify ( Comp )
11
+ } catch ( err ) {
12
+ return String ( Comp )
13
+ }
14
+ }
15
+
8
16
export default function connectAdvanced (
9
17
/*
10
18
selectorFactory is a func that is responsible for returning the selector function used to
@@ -86,7 +94,7 @@ export default function connectAdvanced(
86
94
invariant (
87
95
isValidElementType ( WrappedComponent ) ,
88
96
`You must pass a component to the function returned by ` +
89
- `${ methodName } . Instead received ${ JSON . stringify ( WrappedComponent ) } `
97
+ `${ methodName } . Instead received ${ stringifyComponent ( WrappedComponent ) } `
90
98
)
91
99
}
92
100
You can’t perform that action at this time.
0 commit comments