File tree Expand file tree Collapse file tree 3 files changed +16
-16
lines changed
node_modules/overmind-components/src Expand file tree Collapse file tree 3 files changed +16
-16
lines changed Original file line number Diff line number Diff line change 11import { Null } from './Null'
22import { TApp , Configuration } from 'overmind'
33
4- export type TComponent <
5- Config extends Configuration ,
6- Props = { } ,
7- Children = any
8- > = (
9- props : {
10- state : TApp < Config > [ 'state' ]
11- actions : TApp < Config > [ 'actions ' ]
12- children ?: Children
13- } & Props
4+ export type TComponent < Config extends Configuration , Props = { } > = (
5+ props : Props extends { children : any }
6+ ? {
7+ state : TApp < Config > [ 'state' ]
8+ actions : TApp < Config > [ 'actions' ]
9+ } & Props
10+ : {
11+ state : TApp < Config > [ 'state ' ]
12+ actions : TApp < Config > [ 'actions' ]
13+ } & Props & { children : any }
1414) => any
1515
1616export type FormEvent < T > = {
Original file line number Diff line number Diff line change @@ -16,11 +16,7 @@ declare module 'overmind' {
1616 interface IConfig extends TConfig < typeof config > { }
1717}
1818
19- export type Component < Props = { } , Children = any > = TComponent <
20- typeof config ,
21- Props ,
22- Children
23- >
19+ export type Component < Props = { } > = TComponent < typeof config , Props >
2420
2521const app = new Overmind ( config )
2622
Original file line number Diff line number Diff line change @@ -2,7 +2,11 @@ import { h } from 'overmind-components'
22import { Component } from '../../app'
33import { icon , icons } from './styles'
44
5- const Icon : Component < { } , keyof typeof icons > = ( { children } ) => (
5+ type Props = {
6+ children : keyof typeof icons
7+ }
8+
9+ const Icon : Component < Props > = ( { children } ) => (
610 < span className = { icon ( String ( children ) ) } />
711)
812
You can’t perform that action at this time.
0 commit comments