@plasmicapp/react-web 0.2.227 → 0.2.229

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/index.cjs.js CHANGED
@@ -1402,12 +1402,13 @@ var PlasmicLink = React__default['default'].forwardRef(function PlasmicLink(prop
1402
1402
  var _a;
1403
1403
  // The usePlasmicLinkMaybe function may be undefined, if host is not up-to-date
1404
1404
  var Link = (_a = host.usePlasmicLinkMaybe === null || host.usePlasmicLinkMaybe === void 0 ? void 0 : host.usePlasmicLinkMaybe()) !== null && _a !== void 0 ? _a : PlasmicLinkInternal;
1405
- if (Link === PlasmicLink) {
1405
+ if (Link === PlasmicLink || Link === PlasmicLinkInternal) {
1406
1406
  // Just in case, break the cycle
1407
1407
  return React__default['default'].createElement(PlasmicLinkInternal, __assign({}, props, { ref: ref }));
1408
1408
  }
1409
1409
  else {
1410
- return React__default['default'].createElement(Link, __assign({}, props, { ref: ref }));
1410
+ // Don't pass component/platform props to non-PlasmicLinkInternal
1411
+ return React__default['default'].createElement(Link, __assign({}, omit(props, "component", "platform"), { ref: ref }));
1411
1412
  }
1412
1413
  });
1413
1414
  var PlasmicLinkInternal = React__default['default'].forwardRef(function PlasmicLinkInternal(props, ref) {
@@ -1674,7 +1675,19 @@ function PlasmicRootProvider(props) {
1674
1675
  React__namespace.createElement(dataSourcesContext.PlasmicDataSourceContextProvider, { value: dataSourceContextValue },
1675
1676
  React__namespace.createElement(PlasmicTranslatorContext.Provider, { value: (_a = props.i18n) !== null && _a !== void 0 ? _a : props.translator },
1676
1677
  React__namespace.createElement(PlasmicHeadContext.Provider, { value: props.Head },
1677
- React__namespace.createElement(host.PlasmicLinkProvider, { Link: (_b = props.Link) !== null && _b !== void 0 ? _b : PlasmicLinkInternal }, children))))))));
1678
+ React__namespace.createElement(SafePlasmicLinkProvider, { Link: (_b = props.Link) !== null && _b !== void 0 ? _b : PlasmicLinkInternal }, children))))))));
1679
+ }
1680
+ /**
1681
+ * A PlasmicLinkProvider that anticipates PlasmicLinkProvider may not exist yet from
1682
+ * @plasmicapp/host if the user is using an older version
1683
+ */
1684
+ function SafePlasmicLinkProvider(props) {
1685
+ if (host.PlasmicLinkProvider) {
1686
+ return React__namespace.createElement(host.PlasmicLinkProvider, __assign({}, props));
1687
+ }
1688
+ else {
1689
+ return React__namespace.createElement(React__namespace.Fragment, null, props.children);
1690
+ }
1678
1691
  }
1679
1692
  var useIsSSR = ssr.useIsSSR;
1680
1693
  function useHasPlasmicRoot() {