@@ -21,35 +21,28 @@ export function App(): React.ReactElement {
2121}
2222
2323export function ExampleComponent ( ) : React . ReactElement {
24- const { log } = useLog ( { styles : { componentCSS : 'color: darkBlue;' } } )
25- const [ state , setState ] = useState < string | null > ( null )
26- const [ anotherState , setAnotherState ] = useState < string | null > ( null )
24+ const { log } = useLog ( )
25+ const [ currentState , setCurrentState ] = useState < object > ( { } )
2726
28- log ( state )
29- log ( anotherState , { styles : { componentCSS : 'color: darkRed;' } } )
30-
31- log ( anotherState , {
32- groupLabelRenderer : ( type , name ) => `Such a group! ${ type } & ${ name } ` ,
33- } )
27+ log ( currentState )
3428
3529 useEffect ( function setStateMount ( ) {
36- setState ( 'onMount' )
37- setAnotherState ( 'onMount' )
30+ setCurrentState ( { a : 'Test' , b : 'Value' , state : 'OnMount' } )
3831
3932 setTimeout ( function setStateChange1 ( ) {
40- setState ( ' onChange 1s')
33+ setCurrentState ( { a : 'Test' , b : 'Value' , state : ' onChange 1s' } )
4134 } , 1000 )
4235
4336 setTimeout ( function setStateChange2 ( ) {
44- setState ( ' onChange 2s')
37+ setCurrentState ( { a : 'Test' , b : 'Value' , state : ' onChange 2s' } )
4538 } , 2000 )
4639
4740 return function setStateUnmount ( ) {
48- setState ( ' onUnmount')
41+ setCurrentState ( { a : 'Test' , b : 'Value' , state : ' onUnmount' } )
4942 }
5043 } , [ ] )
5144
52- return < p > Test Component: { state } </ p >
45+ return < p > Test Component: { JSON . stringify ( currentState ) } </ p >
5346}
5447
5548const DefaultMeta : ComponentMeta < typeof App > = {
0 commit comments