@solidjs/web 2.0.0-experimental.1 → 2.0.0-experimental.2

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.
package/dist/server.cjs CHANGED
@@ -592,16 +592,19 @@ function notSup() {
592
592
 
593
593
  const isServer = true;
594
594
  const isDev = false;
595
- function Dynamic(props) {
596
- const [p, others] = solidJs.splitProps(props, ["component"]);
597
- const comp = p.component,
595
+ function createDynamic(component, props) {
596
+ const comp = component(),
598
597
  t = typeof comp;
599
598
  if (comp) {
600
- if (t === "function") return comp(others);else if (t === "string") {
601
- return ssrElement(comp, others, undefined, true);
599
+ if (t === "function") return comp(props);else if (t === "string") {
600
+ return ssrElement(comp, props, undefined, true);
602
601
  }
603
602
  }
604
603
  }
604
+ function Dynamic(props) {
605
+ const [, others] = solidJs.splitProps(props, ["component"]);
606
+ return createDynamic(() => props.component, others);
607
+ }
605
608
  function Portal(props) {
606
609
  return "";
607
610
  }
@@ -678,6 +681,7 @@ exports.SVGNamespace = SVGNamespace;
678
681
  exports.addEventListener = notSup;
679
682
  exports.assign = notSup;
680
683
  exports.className = notSup;
684
+ exports.createDynamic = createDynamic;
681
685
  exports.delegateEvents = notSup;
682
686
  exports.dynamicProperty = notSup;
683
687
  exports.escape = escape;