Я не знаю, как объединить инициалы
warpRootElement (нет 1,2) . Я прошу вашего совета.
import {wrapRootElement as wrap} from './root-wrapper'
require('prismjs/themes/prism.css')
import React, { useState, useEffect } from "react";
import { checkSession } from "./src/utils/auth";
const SessionCheck = ({ children }) => {
const [loading, stillLoading] = useState(true);
useEffect(() => checkSession(() => stillLoading(false)));
return loading === false && <>{children}</>;
};
1, export const wrapRootElement = ({ element }) => {
return <SessionCheck >{element}</SessionCheck>;
};
2, export const wrapRootElement = wrap