Skip to content

Commit 4bcfedd

Browse files
committed
fix process is not defined in react-native
1 parent 84d6fda commit 4bcfedd

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/utils/combineReducers.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,20 @@ export default function combineReducers(reducers) {
105105
return newState;
106106
});
107107

108-
if (process.env.NODE_ENV !== 'production' && !stateShapeVerified) {
109-
verifyStateShape(state, finalState);
110-
stateShapeVerified = true;
108+
if ((
109+
// Node-like CommonJS environments (Browserify, Webpack)
110+
typeof process !== 'undefined' &&
111+
typeof process.env !== 'undefined' &&
112+
process.env.NODE_ENV !== 'production'
113+
) ||
114+
// React Native
115+
typeof __DEV__ !== 'undefined' &&
116+
__DEV__ //eslint-disable-line no-undef
117+
) {
118+
if (!stateShapeVerified) {
119+
verifyStateShape(state, finalState);
120+
stateShapeVerified = true;
121+
}
111122
}
112123

113124
return finalState;

0 commit comments

Comments
 (0)