import React, { Component, useEffect } 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; class NavTop extends Component { constructor(props) { super(props); this.state = { userName: '', intervieweEamil: '', headImg: '', isShowTimer: false, }; } timerRef = React.createRef(); componentDidMount() { PubSub.subscribe('handleToRender', () => { this.setState({}); }); } render() { let { headImg, isShowTimer } = this.state; 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 App