import { useEffect, memo } from 'react'; import './App.less'; import { useLocation, useNavigate, Outlet } from 'react-router-dom'; import PubSub from 'pubsub-js'; import { Input } from 'antd'; import Logo from '@views/imgs/logo.jpg' import Head from '@views/imgs/head.jpg' import TopMenu from '@components/top-menu' const { Search } = Input; const NavTop = () => { const { pathname } = window.location; return (
(window.location.href = '/question-bank') }>
{'/question-bank' == pathname && (
console.log(value)} style={{ width: 300, borderRadius: '10px' }} />
)}
{/* */}
) } const App = () => { const location = useLocation(); const navigate = useNavigate() useEffect(() => { if (location.pathname === '/') { navigate('/question-bank') } }, [location]) return (
) } export default memo(App)