S
SolidJS14mo ago
Sreeni

Issue with multiple useTransition

https://playground.solidjs.com/anonymous/ad274a3f-5cd0-4fa2-a852-c64bde3cdb77 Use the above playground link to see it in action. When clicking either one of the buttons, both show loading... Is this an expected behavior? A workaround is to use the below useTransition instead
export default function useTransition() {
const [pending, setPending] = createSignal(false);
async function start(fn: () => unknown) {
setPending(true);
await startTransition(() => {
fn();
});
setPending(false);
}
return [pending, start];
}
export default function useTransition() {
const [pending, setPending] = createSignal(false);
async function start(fn: () => unknown) {
setPending(true);
await startTransition(() => {
fn();
});
setPending(false);
}
return [pending, start];
}
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server