import React, { useRef, useEffect } from 'react';
import { renderToStatic } from '../render-node-to-output.js';
export default function StaticRender({ children, width, style }) {
    const ref = useRef(null);
    useEffect(() => {
        const node = ref.current;
        return () => {
            if (node) {
                node.cachedRender = undefined;
            }
        };
    }, []);
    return (React.createElement("ink-static-render", { ref: ref, style: { ...style, width }, internalOnBeforeRender: (node) => {
            if (node && !node.cachedRender) {
                renderToStatic(node);
            }
        } }, children));
}
//# sourceMappingURL=StaticRender.js.map