I am trying to open modal inside ProtectedRoute wrapper but it doesn't work
export const ProtectedRoute = ({ children }: { children: ReactElement }) => {
const { isLogged } = AuthConsumer();
if (isLogged) {
return children;
}
openModal({
title: "Login",
children: (
<Login
onClose={() => {
closeAllModals();
}}
/>
),
});
return <Navigate to="/" replace />;
};
I am not able to show full example, as in my case modals doesn't work on sandbox..