File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -32,13 +32,13 @@ export function variantFactory(context: Context) {
3232 useUnitConfig ?: UseUnitConifg ;
3333 } ,
3434 ) : ( p : Props ) => React . ReactNode {
35- let $case : Store < Variant > ;
35+ let $case : Store < Variant | boolean > ;
3636 let cases : Record < Variant , View < Props > > ;
3737 let def : View < Props > ;
3838
3939 // Shortcut for Store<boolean>
4040 if ( 'if' in config ) {
41- $case = config . if as any ;
41+ $case = config . if ;
4242 cases = {
4343 then : config . then ,
4444 else : config . else ,
@@ -53,10 +53,7 @@ export function variantFactory(context: Context) {
5353 }
5454
5555 function View ( props : Props ) {
56- const nameOfCaseRaw = context . useUnit (
57- $case as Store < string | boolean > ,
58- config . useUnitConfig ,
59- ) ;
56+ const nameOfCaseRaw = context . useUnit ( $case , config . useUnitConfig ) ;
6057 const nameOfCase = (
6158 typeof nameOfCaseRaw === 'string'
6259 ? nameOfCaseRaw
You can’t perform that action at this time.
0 commit comments