import { render } from 'preact';
// import { factory, withInitDataInState } from '../../compat/initData.js';
import { profileEnd, profileStart } from '../debug/profile.js';
// import { useLynxGlobalEventListener } from '../../core/hooks/useLynxGlobalEventListener.js';
import { __root } from '../runtime/page/root-instance.js';
/**
 * The default and only root of ReactLynx for you to render JSX
 * @example
 * ```ts
 * import { root } from "@lynx-js/react"
 * ```
 *
 * @public
 */
export const root = {
    render: (jsx) => {
        __root.__jsx = jsx;
        if (__BACKGROUND__) {
            if (__PROFILE__) {
                profileStart('ReactLynx::renderBackground');
            }
            render(jsx, __root);
            if (__PROFILE__) {
                profileEnd();
            }
        }
    },
    /* v8 ignore next 3 */
    // registerDataProcessors: (dataProcessorDefinition: DataProcessorDefinition): void => {
    //   lynx.registerDataProcessors(dataProcessorDefinition);
    // },
};
//# sourceMappingURL=root.js.map