Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function mountClient(routeConfig) {
const environment = createRelayEnvironment(
JSON.parse(window.__RELAY_BOOTSTRAP__)
) // eslint-disable-line
const historyMiddlewares = [queryMiddleware]
const resolver = new Resolver(environment)
const render = createRender({})
try {
const Router = await createInitialFarceRouter({
historyProtocol: new BrowserProtocol(),
historyMiddlewares,
routeConfig,
resolver,
render,
})
Loadable.preloadReady().then(() => {
ReactDOM.hydrate(
export async function mountClient(routeConfig) {
const fetcher = new ClientFetcher(
process.env.METAPHYSICS_BASE_URL,
window.__RELAY_PAYLOADS__
)
const resolver = createResolver(fetcher)
const render = createRender({})
const Router = await createInitialFarceRouter({
historyProtocol: new BrowserProtocol(),
historyMiddlewares: [queryMiddleware],
routeConfig,
resolver,
render,
})
ReactDOM.hydrate(
,
document.getElementById('root')
)
}
export async function createClientRouter(resolver) {
const historyProtocol = new BrowserProtocol();
const Router = await createInitialFarceRouter({
historyProtocol,
historyMiddlewares,
routeConfig: require(process.env.REACT_APP_PATH).default,
resolver,
render
});
return Router;
}