File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,26 @@ export const createComponent = (
1919export const createComponentWithFallback = (
2020 type : VaporComponent | typeof Fragment ,
2121 ...args : Tail < Parameters < typeof _createComponentWithFallback > >
22- ) => createProxyComponent ( _createComponentWithFallback , type , ...args )
22+ ) => {
23+ const slots = args [ 1 ]
24+ if (
25+ typeof type === 'string' &&
26+ slots &&
27+ slots . default &&
28+ typeof slots . default === 'function'
29+ ) {
30+ const defaultSlot = slots . default
31+ slots . default = ( ) => {
32+ return createProxyComponent (
33+ _createComponentWithFallback ,
34+ defaultSlot ,
35+ null ,
36+ null ,
37+ )
38+ }
39+ }
40+ return createProxyComponent ( _createComponentWithFallback , type , ...args )
41+ }
2342
2443const createProxyComponent = (
2544 createComponent :
You can’t perform that action at this time.
0 commit comments