SolidJSS
SolidJSโ€ข3y agoโ€ข
8 replies
Sreeni

Transition state getting lost after an await inside ResourceFetcher

https://playground.solidjs.com/anonymous/c2f53a7d-9e76-4711-8e81-aa6bc2de12c6
Check the above link to see it in action

Say if we have the following signal
const [show, setShow] = createSignal(false);


And if we call setShow(true) within startTransition
startTransition(() => setShow(true));


And somewhere inside ResourceFetcher the value of show() is different above & below an await point as shown below
  console.log('show=', show()); // true
  await new Promise((r) => setTimeout(r, 1));
  console.log('show=', show()); // false !!!
Quickly discover what the solid compiler will generate from your JSX template
Was this page helpful?