File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 1
1
// Ignoring missing types error to avoid adding another dependency for this hack to work
2
2
// @ts -ignore
3
3
import ws from 'ws' ;
4
+ // @ts -ignore
5
+ import { connectToDevTools } from 'react-devtools-core' ;
4
6
5
7
const customGlobal = global as any ;
6
8
@@ -69,10 +71,4 @@ customGlobal.window.__REACT_DEVTOOLS_COMPONENT_FILTERS__ = [
69
71
}
70
72
] ;
71
73
72
- // Ignoring missing types error to avoid adding another dependency for this hack to work
73
- // @ts -ignore
74
- import { connectToDevTools } from 'react-devtools-core' ;
75
-
76
- if ( process . env . DEV === 'true' ) {
77
- connectToDevTools ( ) ;
78
- }
74
+ connectToDevTools ( ) ;
Original file line number Diff line number Diff line change @@ -23,8 +23,14 @@ import type {
23
23
} from './dom' ;
24
24
import type { Styles } from './styles' ;
25
25
import type { OutputTransformer } from './render-node-to-output' ;
26
- // eslint-disable-next-line import/no-unassigned-import
27
- import './devtools' ;
26
+
27
+ // We need to conditionally perform devtools connection to avoid
28
+ // accidentally breaking other third-party code.
29
+ // See https://github.com/vadimdemedes/ink/issues/384
30
+ if ( process . env . DEV === 'true' ) {
31
+ // eslint-disable-next-line import/no-unassigned-import
32
+ require ( './devtools' ) ;
33
+ }
28
34
29
35
const cleanupYogaNode = ( node ?: Yoga . YogaNode ) : void => {
30
36
node ?. unsetMeasureFunc ( ) ;
You can’t perform that action at this time.
0 commit comments