"use client";
import { isMotionValue } from "./index206.js";
import { filterProps } from "./index315.js";
import { useHTMLProps } from "./index320.js";
import { useSVGProps } from "./index322.js";
import { isSVGComponent } from "./index324.js";
import { Fragment, createElement, useMemo } from "react";
//#region node_modules/framer-motion/dist/es/render/dom/use-render.mjs
function useRender(Component, props, ref, { latestValues }, isStatic, forwardMotionProps = false, isSVG) {
	const visualProps = (isSVG ?? isSVGComponent(Component) ? useSVGProps : useHTMLProps)(props, latestValues, isStatic, Component);
	const filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps);
	const elementProps = Component !== Fragment ? {
		...filteredProps,
		...visualProps,
		ref
	} : {};
	/**
	* If component has been handed a motion value as its child,
	* memoise its initial value and render that. Subsequent updates
	* will be handled by the onChange handler
	*/
	const { children } = props;
	const renderedChildren = useMemo(() => isMotionValue(children) ? children.get() : children, [children]);
	return createElement(Component, {
		...elementProps,
		children: renderedChildren
	});
}
//#endregion
export { useRender };

//# sourceMappingURL=index325.js.map