Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d42843e commit be1f921Copy full SHA for be1f921
1 file changed
packages/warning/src/index.js
@@ -1,3 +1,11 @@
1
+function isDev() {
2
+ return (
3
+ typeof process !== 'undefined' &&
4
+ process.env &&
5
+ process.env.NODE_ENV !== 'production'
6
+ );
7
+}
8
+
9
/**
10
* Shows a warning with `messages` if `condition` passes and environment is not `production`.
11
*
@@ -15,7 +23,7 @@
15
23
* ```
16
24
*/
17
25
export default function warning( condition, ...messages ) {
18
- if ( process.env.NODE_ENV !== 'production' ) {
26
+ if ( isDev() ) {
19
27
if ( ! condition ) {
20
28
return;
21
29
}
0 commit comments