File tree Expand file tree Collapse file tree 3 files changed +31
-3
lines changed Expand file tree Collapse file tree 3 files changed +31
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @qwik.dev/core ' : patch
3+ ---
4+
5+ fix: removing children from var props
Original file line number Diff line number Diff line change @@ -66,12 +66,12 @@ export const _jsxSplit = <T extends string | FunctionComponent<any>>(
6666 for ( const k in varProps ) {
6767 if ( k === 'children' ) {
6868 children ||= varProps . children as JSXChildren ;
69- varProps . children = undefined ;
69+ delete varProps . children ;
7070 } else if ( k === 'key' ) {
7171 key ||= varProps . key as string ;
72- varProps . key = undefined ;
72+ delete varProps . key ;
7373 } else if ( constProps && k in constProps ) {
74- varProps [ k ] = undefined ;
74+ delete varProps [ k ] ;
7575 }
7676 }
7777 }
Original file line number Diff line number Diff line change 66 Fragment as Signal ,
77 Slot ,
88 component$ ,
9+ jsx ,
910 useSignal ,
1011 useStore ,
1112 useVisibleTask$ ,
@@ -41,6 +42,16 @@ const ChildInline = () => {
4142 return < div > Child inline</ div > ;
4243} ;
4344
45+ const OwnKeys = {
46+ HAccordionRoot : ( props : any ) => {
47+ return jsx ( 'div' , props ) ;
48+ } ,
49+ Root : ( props : any ) => < OwnKeys . HAccordionRoot { ...props } accordionItemComponent = { OwnKeys . Item } /> ,
50+ Item : component$ ( ( ) => {
51+ return < > </ > ;
52+ } ) ,
53+ } ;
54+
4455describe . each ( [
4556 { render : ssrRenderToDom } , //
4657 { render : domRender } , //
@@ -732,4 +743,16 @@ describe.each([
732743 </ InlineComponent >
733744 ) ;
734745 } ) ;
746+
747+ it ( 'should remove children from varProps and not throw' , async ( ) => {
748+ const Cmp = component$ ( ( ) => {
749+ return (
750+ < OwnKeys . Root class = "w-96" >
751+ < OwnKeys . Item />
752+ </ OwnKeys . Root >
753+ ) ;
754+ } ) ;
755+
756+ await expect ( render ( < Cmp /> , { debug } ) ) . resolves . not . toThrow ( ) ;
757+ } ) ;
735758} ) ;
You can’t perform that action at this time.
0 commit comments