@@ -28,6 +28,7 @@ describe('ReactHooksInspection', () => {
28
28
let tree = ReactDebugTools . inspectHooks ( Foo , { } ) ;
29
29
expect ( tree ) . toEqual ( [
30
30
{
31
+ isEditable : true ,
31
32
index : 0 ,
32
33
name : 'State' ,
33
34
value : 'hello world' ,
@@ -49,11 +50,13 @@ describe('ReactHooksInspection', () => {
49
50
let tree = ReactDebugTools . inspectHooks ( Foo , { } ) ;
50
51
expect ( tree ) . toEqual ( [
51
52
{
53
+ isEditable : false ,
52
54
index : - 1 ,
53
55
name : 'Custom' ,
54
56
value : __DEV__ ? 'custom hook label' : undefined ,
55
57
subHooks : [
56
58
{
59
+ isEditable : true ,
57
60
index : 0 ,
58
61
name : 'State' ,
59
62
value : 'hello world' ,
@@ -83,17 +86,20 @@ describe('ReactHooksInspection', () => {
83
86
let tree = ReactDebugTools . inspectHooks ( Foo , { } ) ;
84
87
expect ( tree ) . toEqual ( [
85
88
{
89
+ isEditable : false ,
86
90
index : - 1 ,
87
91
name : 'Custom' ,
88
92
value : undefined ,
89
93
subHooks : [
90
94
{
95
+ isEditable : true ,
91
96
index : 0 ,
92
97
name : 'State' ,
93
98
subHooks : [ ] ,
94
99
value : 'hello' ,
95
100
} ,
96
101
{
102
+ isEditable : false ,
97
103
index : 1 ,
98
104
name : 'Effect' ,
99
105
subHooks : [ ] ,
@@ -102,17 +108,20 @@ describe('ReactHooksInspection', () => {
102
108
] ,
103
109
} ,
104
110
{
111
+ isEditable : false ,
105
112
index : - 1 ,
106
113
name : 'Custom' ,
107
114
value : undefined ,
108
115
subHooks : [
109
116
{
117
+ isEditable : true ,
110
118
index : 2 ,
111
119
name : 'State' ,
112
120
value : 'world' ,
113
121
subHooks : [ ] ,
114
122
} ,
115
123
{
124
+ isEditable : false ,
116
125
index : 3 ,
117
126
name : 'Effect' ,
118
127
value : effect ,
@@ -152,22 +161,26 @@ describe('ReactHooksInspection', () => {
152
161
let tree = ReactDebugTools . inspectHooks ( Foo , { } ) ;
153
162
expect ( tree ) . toEqual ( [
154
163
{
164
+ isEditable : false ,
155
165
index : - 1 ,
156
166
name : 'Bar' ,
157
167
value : undefined ,
158
168
subHooks : [
159
169
{
170
+ isEditable : false ,
160
171
index : - 1 ,
161
172
name : 'Custom' ,
162
173
value : undefined ,
163
174
subHooks : [
164
175
{
176
+ isEditable : true ,
165
177
index : 0 ,
166
178
name : 'Reducer' ,
167
179
value : 'hello' ,
168
180
subHooks : [ ] ,
169
181
} ,
170
182
{
183
+ isEditable : false ,
171
184
index : 1 ,
172
185
name : 'Effect' ,
173
186
value : effect ,
@@ -176,6 +189,7 @@ describe('ReactHooksInspection', () => {
176
189
] ,
177
190
} ,
178
191
{
192
+ isEditable : false ,
179
193
index : 2 ,
180
194
name : 'LayoutEffect' ,
181
195
value : effect ,
@@ -184,27 +198,32 @@ describe('ReactHooksInspection', () => {
184
198
] ,
185
199
} ,
186
200
{
201
+ isEditable : false ,
187
202
index : - 1 ,
188
203
name : 'Baz' ,
189
204
value : undefined ,
190
205
subHooks : [
191
206
{
207
+ isEditable : false ,
192
208
index : 3 ,
193
209
name : 'LayoutEffect' ,
194
210
value : effect ,
195
211
subHooks : [ ] ,
196
212
} ,
197
213
{
214
+ isEditable : false ,
198
215
index : - 1 ,
199
216
name : 'Custom' ,
200
217
subHooks : [
201
218
{
219
+ isEditable : true ,
202
220
index : 4 ,
203
221
name : 'Reducer' ,
204
222
subHooks : [ ] ,
205
223
value : 'world' ,
206
224
} ,
207
225
{
226
+ isEditable : false ,
208
227
index : 5 ,
209
228
name : 'Effect' ,
210
229
subHooks : [ ] ,
@@ -227,6 +246,7 @@ describe('ReactHooksInspection', () => {
227
246
let tree = ReactDebugTools . inspectHooks ( Foo , { } ) ;
228
247
expect ( tree ) . toEqual ( [
229
248
{
249
+ isEditable : false ,
230
250
index : 0 ,
231
251
name : 'Context' ,
232
252
value : 'default' ,
@@ -290,10 +310,13 @@ describe('ReactHooksInspection', () => {
290
310
let tree = ReactDebugTools . inspectHooks ( Foo , { } ) ;
291
311
expect ( tree ) . toEqual ( [
292
312
{
313
+ isEditable : false ,
293
314
index : - 1 ,
294
315
name : 'Custom' ,
295
316
value : __DEV__ ? 'bar:123' : undefined ,
296
- subHooks : [ { index : 0 , name : 'State' , subHooks : [ ] , value : 0 } ] ,
317
+ subHooks : [
318
+ { isEditable : true , index : 0 , name : 'State' , subHooks : [ ] , value : 0 } ,
319
+ ] ,
297
320
} ,
298
321
] ) ;
299
322
} ) ;
0 commit comments