File tree 3 files changed +28
-12
lines changed
shells/dev/app/InspectableElements
3 files changed +28
-12
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ const contextData = {
13
13
object : { outer : { inner : { } } } ,
14
14
string : 'abc' ,
15
15
symbol : Symbol . for ( 'symbol' ) ,
16
+ null : null ,
17
+ undefined : undefined ,
16
18
} ;
17
19
18
20
class LegacyContextProvider extends Component < any > {
@@ -24,6 +26,8 @@ class LegacyContextProvider extends Component<any> {
24
26
object : PropTypes . object ,
25
27
string : PropTypes . string ,
26
28
symbol : PropTypes . symbol ,
29
+ null : PropTypes . any ,
30
+ undefined : PropTypes . any ,
27
31
} ;
28
32
29
33
getChildContext ( ) {
@@ -44,6 +48,8 @@ class LegacyContextConsumer extends Component<any> {
44
48
object : PropTypes . object ,
45
49
string : PropTypes . string ,
46
50
symbol : PropTypes . symbol ,
51
+ null : PropTypes . any ,
52
+ undefined : PropTypes . any ,
47
53
} ;
48
54
49
55
render ( ) {
Original file line number Diff line number Diff line change 2
2
3
3
import React from 'react' ;
4
4
5
+ const object = {
6
+ string : 'abc' ,
7
+ longString : 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKJLMNOPQRSTUVWXYZ1234567890' ,
8
+ emptyString : '' ,
9
+ number : 123 ,
10
+ boolean : true ,
11
+ undefined : undefined ,
12
+ null : null ,
13
+ } ;
14
+
5
15
export default function ObjectProps ( ) {
6
16
return (
7
17
< ChildComponent
8
18
object = { {
9
19
outer : {
10
- inner : {
11
- string : 'abc' ,
12
- number : 123 ,
13
- boolean : true ,
14
- } ,
20
+ inner : object ,
15
21
} ,
16
22
} }
17
23
array = { [ 'first' , 'second' , 'third' ] }
18
- objectInArray = { [
19
- {
20
- string : 'abc' ,
21
- number : 123 ,
22
- boolean : true ,
23
- } ,
24
- ] }
24
+ objectInArray = { [ object ] }
25
25
arrayInObject = { { array : [ 'first' , 'second' , 'third' ] } }
26
26
/>
27
27
) ;
Original file line number Diff line number Diff line change @@ -86,6 +86,15 @@ export default function EditableValue({
86
86
inputValue = editableValue == null ? '' : editableValue ;
87
87
}
88
88
89
+ let placeholder = '' ;
90
+ if ( value === null ) {
91
+ placeholder = '(null)' ;
92
+ } else if ( value === undefined ) {
93
+ placeholder = '(undefined)' ;
94
+ } else if ( dataType === 'string' ) {
95
+ placeholder = '(string)' ;
96
+ }
97
+
89
98
return (
90
99
< Fragment >
91
100
{ dataType === 'boolean' && (
@@ -105,6 +114,7 @@ export default function EditableValue({
105
114
className = { styles . Input }
106
115
onChange = { handleChange }
107
116
onKeyDown = { handleKeyDown }
117
+ placeholder = { placeholder }
108
118
ref = { inputRef }
109
119
type = { type }
110
120
value = { inputValue }
You can’t perform that action at this time.
0 commit comments