import { jsx as _jsx } from "react/jsx-runtime";
import { useState } from 'react';
import { RouterProvider } from 'react-router/dom';
import { useRecoilCallback } from 'recoil';
import { RouterContextProvider } from './context';
import { createRouter } from './create-router';
function RouterRoot({ daraData }) {
    const getSnapshot = useRecoilCallback((ctx) => () => ctx.snapshot, []);
    const [routerData] = useState(() => createRouter(daraData, getSnapshot));
    return (_jsx(RouterContextProvider, { routeDefinitions: routerData.routeDefinitions, routeObjects: routerData.routeObjects, routeDefMap: routerData.routeDefMap, defaultPath: routerData.defaultPath, routeMatches: routerData.routeMatches, children: _jsx(RouterProvider, { router: routerData.router }) }));
}
export default RouterRoot;
//# sourceMappingURL=router-root.js.map