-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] 답변 모달 띄운 상태에서 브라우저 UI 뒤로가기 누르면 알 수 없음 오류 발생 #447
Comments
발생 이유
// Panel.tsx
const overlay = useOverlay();
return <button onClick={() => overlay.open(<QAModal />)}/>
const { author, ...panel } = useRouteLoaderData('panel') as Panel;
왜 새로 렌더링되고 있는 걸까? |
페이지 이동 시 이전 페이지는 새로 이동한 페이지가 렌더링된 후 언마운트된다import React, { useEffect } from 'react';
import { Link, RouterProvider, createBrowserRouter } from 'react-router-dom';
function Index(): JSX.Element {
console.log('/index 렌더링 중');
return <Link to="hello">/hello</Link>;
}
function Hello(): JSX.Element {
useEffect(
() => () => {
console.log('/hello 클린업');
},
[],
);
return <div>Hello</div>;
}
const router = createBrowserRouter([
{
path: '/',
index: true,
element: <Index />,
},
{
path: '/hello',
element: <Hello />,
},
]);
export function App(): JSX.Element {
return <RouterProvider router={router} />;
}
나는
|
🔄 How to reproduce bug
📷 Screenshots
The text was updated successfully, but these errors were encountered: