Skip to content

Commit

Permalink
chore: path
Browse files Browse the repository at this point in the history
  • Loading branch information
lencx committed Nov 13, 2023
1 parent b41d5b8 commit df50e81
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
import React from 'react';
import React, { useLayoutEffect } from 'react';
import ReactDOM from 'react-dom/client';
import { BrowserRouter } from 'react-router-dom';

import BaseLayout from '@/layouts/base';
import './index.css';

ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
// eslint-disable-next-line react-refresh/only-export-components
function App() {
useLayoutEffect(() => {
if (window.location.pathname === '/') {
window.location.href = '/gpthub/';
}
}, [])
return (
<BrowserRouter basename="/gpthub">
<BaseLayout />
</BrowserRouter>
)
}

ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<App />
</React.StrictMode>,
)

0 comments on commit df50e81

Please sign in to comment.