"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const React = require("react");
const useProps$1 = require("./dist-es-render-html-use-props.cjs");
const filterProps = require("./dist-es-render-dom-utils-filter-props.cjs");
const isSvgComponent = require("./dist-es-render-dom-utils-is-svg-component.cjs");
const useProps = require("./dist-es-render-svg-use-props.cjs");
const isMotionValue = require("./dist-es-value-utils-is-motion-value.cjs");
function createUseRender(forwardMotionProps = false) {
  const useRender = (Component, props, ref, { latestValues }, isStatic) => {
    const useVisualProps = isSvgComponent.isSVGComponent(Component) ? useProps.useSVGProps : useProps$1.useHTMLProps;
    const visualProps = useVisualProps(props, latestValues, isStatic, Component);
    const filteredProps = filterProps.filterProps(props, typeof Component === "string", forwardMotionProps);
    const elementProps = Component !== React.Fragment ? { ...filteredProps, ...visualProps, ref } : {};
    const { children } = props;
    const renderedChildren = React.useMemo(() => isMotionValue.isMotionValue(children) ? children.get() : children, [children]);
    return React.createElement(Component, {
      ...elementProps,
      children: renderedChildren
    });
  };
  return useRender;
}
exports.createUseRender = createUseRender;
//# sourceMappingURL=dist-es-render-dom-use-render.cjs.map
