Skip to content

Commit b56bc1a

Browse files
author
Brian Vaughn
committed
Initial pass at properties panel. Lots of TODOs remaining.
1 parent 406df2a commit b56bc1a

34 files changed

+1847
-113
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
"react": "^16.8.0-alpha.1",
8989
"react-color": "^2.11.7",
9090
"react-dom": "^16.8.0-alpha.1",
91+
"react-is": "^16.8.0-alpha.1",
9192
"react-portal": "^3.1.0",
9293
"react-virtualized-auto-sizer": "^1.0.2",
9394
"react-window": "^1.5.1",

shells/dev/app/App.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
// @flow
22

33
import React from 'react';
4-
import List from './ToDoList';
54
import ElementTypes from './ElementTypes';
5+
import InspectableElements from './InspectableElements';
6+
import List from './ToDoList';
67
import styles from './App.css';
78

89
export default function App() {
910
return (
1011
<div className={styles.App}>
1112
<List />
1213
<ElementTypes />
14+
<InspectableElements />
1315
</div>
1416
);
1517
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// @flow
2+
3+
import React, { useCallback, useState } from 'react';
4+
5+
type Props = {|
6+
initialCount: number,
7+
|};
8+
9+
export default function FunctionWithState({ initialCount }: Props) {
10+
const [count, setCount] = useState(initialCount);
11+
const handleClick = useCallback(() => {
12+
setCount(count => count + 1);
13+
});
14+
15+
return <button onClick={handleClick}>Count {count}</button>;
16+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// @flow
2+
3+
import React, { Fragment } from 'react';
4+
import FunctionWithState from './FunctionWithState';
5+
import NestedProps from './NestedProps';
6+
7+
export default function InspectableElements() {
8+
return (
9+
<Fragment>
10+
<FunctionWithState initialCount={1} />
11+
<NestedProps />
12+
</Fragment>
13+
);
14+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// @flow
2+
3+
import React from 'react';
4+
5+
export default function ObjectProps() {
6+
return (
7+
<ChildComponent
8+
object={{
9+
outer: {
10+
inner: {
11+
string: 'abc',
12+
number: 123,
13+
boolean: true,
14+
},
15+
},
16+
}}
17+
array={['first', 'second', 'third']}
18+
objectInArray={[
19+
{
20+
string: 'abc',
21+
number: 123,
22+
boolean: true,
23+
},
24+
]}
25+
arrayInObject={{ array: ['first', 'second', 'third'] }}
26+
/>
27+
);
28+
}
29+
30+
function ChildComponent(props: any) {
31+
return null;
32+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// @flow
2+
3+
import InspectableElements from './InspectableElements';
4+
5+
export default InspectableElements;

0 commit comments

Comments
 (0)