UNPKG

react-intlayer

Version:

Easily internationalize i18n your React applications with type-safe multilingual content management.

26 lines 656 B
import { Fragment, jsx } from "react/jsx-runtime"; import { isValidElement } from "react"; const renderIntlayerNode = ({ children, value, additionalProps }) => { const element = isValidElement(children) ? children : /* @__PURE__ */ jsx(Fragment, { children }); return new Proxy(element, { get(target, prop, receiver) { if (prop === "value") { return value; } if (additionalProps && Object.keys(additionalProps).includes(prop)) { return additionalProps[prop]; } return Reflect.get(target, prop, receiver); } }); }; export { renderIntlayerNode }; //# sourceMappingURL=IntlayerNode.mjs.map