-
Notifications
You must be signed in to change notification settings - Fork 47.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial pass at properties panel. Lots of TODOs remaining.
- Loading branch information
Brian Vaughn
committed
Feb 4, 2019
1 parent
406df2a
commit b56bc1a
Showing
34 changed files
with
1,847 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
// @flow | ||
|
||
import React from 'react'; | ||
import List from './ToDoList'; | ||
import ElementTypes from './ElementTypes'; | ||
import InspectableElements from './InspectableElements'; | ||
import List from './ToDoList'; | ||
import styles from './App.css'; | ||
|
||
export default function App() { | ||
return ( | ||
<div className={styles.App}> | ||
<List /> | ||
<ElementTypes /> | ||
<InspectableElements /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// @flow | ||
|
||
import React, { useCallback, useState } from 'react'; | ||
|
||
type Props = {| | ||
initialCount: number, | ||
|}; | ||
|
||
export default function FunctionWithState({ initialCount }: Props) { | ||
const [count, setCount] = useState(initialCount); | ||
const handleClick = useCallback(() => { | ||
setCount(count => count + 1); | ||
}); | ||
|
||
return <button onClick={handleClick}>Count {count}</button>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// @flow | ||
|
||
import React, { Fragment } from 'react'; | ||
import FunctionWithState from './FunctionWithState'; | ||
import NestedProps from './NestedProps'; | ||
|
||
export default function InspectableElements() { | ||
return ( | ||
<Fragment> | ||
<FunctionWithState initialCount={1} /> | ||
<NestedProps /> | ||
</Fragment> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// @flow | ||
|
||
import React from 'react'; | ||
|
||
export default function ObjectProps() { | ||
return ( | ||
<ChildComponent | ||
object={{ | ||
outer: { | ||
inner: { | ||
string: 'abc', | ||
number: 123, | ||
boolean: true, | ||
}, | ||
}, | ||
}} | ||
array={['first', 'second', 'third']} | ||
objectInArray={[ | ||
{ | ||
string: 'abc', | ||
number: 123, | ||
boolean: true, | ||
}, | ||
]} | ||
arrayInObject={{ array: ['first', 'second', 'third'] }} | ||
/> | ||
); | ||
} | ||
|
||
function ChildComponent(props: any) { | ||
return null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// @flow | ||
|
||
import InspectableElements from './InspectableElements'; | ||
|
||
export default InspectableElements; |
Oops, something went wrong.