@pyreon/solid-compat 0.13.1 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -260,6 +260,9 @@ function resolveChildInstance(): ChildInstance | undefined {
260
260
 
261
261
  // ─── JSX functions ───────────────────────────────────────────────────────────
262
262
 
263
+ // Tag used by compat context Providers to skip compat wrapping
264
+ const _NATIVE_COMPAT = Symbol.for('pyreon:native-compat')
265
+
263
266
  export function jsx(
264
267
  type: string | ComponentFn | symbol,
265
268
  props: Props & { children?: VNodeChild | VNodeChild[] },
@@ -274,6 +277,12 @@ export function jsx(
274
277
  return h(type as ComponentFn, componentProps)
275
278
  }
276
279
 
280
+ // Native compat components (e.g. context Providers) skip compat wrapping
281
+ if ((type as unknown as Record<symbol, boolean>)[_NATIVE_COMPAT]) {
282
+ const componentProps = children !== undefined ? { ...propsWithKey, children } : propsWithKey
283
+ return h(type as ComponentFn, componentProps)
284
+ }
285
+
277
286
  const wrapped = wrapCompatComponent(type)
278
287
  const componentProps =
279
288
  children !== undefined ? { ...propsWithKey, children } : { ...propsWithKey }