in the LoginForm() component, throw redirect based on a normal async function(handleSession). I believe that would be call once and hard to execute at the time you want.
I have similar issue last week. My solution is set up a cache which handles with the session in the router.load() at first, and create a resource by using createAsync to check whether the session works fine. In the Code as following:
export const route = {
load() {
void getPost();
}
} satisfies RouteDefinition;
export default function Hello() {
const post = createAsync(() => getPost(), {deferStream: true});
return (
<main>
<Title>Hello, this page needs auth</Title>
<h1>Hello</h1>
<p>
{post()}
</p>
</main>
);
export const route = {
load() {
void getPost();
}
} satisfies RouteDefinition;
export default function Hello() {
const post = createAsync(() => getPost(), {deferStream: true});
I think <Show> component is a proper method to meet your demand. Based on the prop of When and the signal of showModal to control the Modal whether open or not.
oh, I know the key point that solidstart will deal with FOUC after build. I think in the dev mode( bun dev in terminal ), FOUS is a common scenario. Am I right?
hello, have you find the solution? I am encountered this problem. FOUC could be removed in the CSR mode, however, the same code in SSR mode unstyled content will be shown a while.