Skip to content

Commit b6c0cf5

Browse files
committed
fix(PropsProxy): only convert jsx propnames for string nodes
1 parent 592fba7 commit b6c0cf5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/qwik/src/core/shared/jsx/props-proxy.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class PropsProxyHandler implements ProxyHandler<any> {
2828
if (prop === 'children') {
2929
value = this.owner.children;
3030
} else {
31-
if (typeof prop === 'string') {
31+
if (typeof prop === 'string' && typeof this.owner.type === 'string') {
3232
const attr = jsxEventToHtmlAttribute(prop as string);
3333
if (attr) {
3434
prop = attr;
@@ -48,7 +48,7 @@ class PropsProxyHandler implements ProxyHandler<any> {
4848
} else if (prop === 'children') {
4949
this.owner.children = value;
5050
} else {
51-
if (typeof prop === 'string') {
51+
if (typeof prop === 'string' && typeof this.owner.type === 'string') {
5252
const attr = jsxEventToHtmlAttribute(prop as string);
5353
if (attr) {
5454
prop = attr;
@@ -90,7 +90,7 @@ class PropsProxyHandler implements ProxyHandler<any> {
9090
} else if (prop === _CONST_PROPS || prop === _VAR_PROPS) {
9191
return true;
9292
}
93-
if (typeof prop === 'string') {
93+
if (typeof prop === 'string' && typeof this.owner.type === 'string') {
9494
const attr = jsxEventToHtmlAttribute(prop as string);
9595
if (attr) {
9696
prop = attr;
@@ -133,6 +133,8 @@ class PropsProxyHandler implements ProxyHandler<any> {
133133
/**
134134
* Instead of using PropsProxyHandler getter (which could create a component-level subscription).
135135
* Use this function to get the props directly from a const or var props.
136+
*
137+
* This does not convert jsx event names.
136138
*/
137139
export const directGetPropsProxyProp = <T, JSX>(jsx: JSXNodeInternal<JSX>, prop: string): T => {
138140
return (

0 commit comments

Comments
 (0)