L3P3 / lui

Tiny, robust web framework in my taste.

Home Page:https://l3p3.de/dok/lui.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiple rerender requests on same component

L3P3 opened this issue · comments

commented
function Parent() {
  hook_rerender();
  console.log('Render!');
  return [
    node(Child),
  ];
}

function Child() {
  const [state, state_set] = hook_state(false);
  hook_effect(() => {
    setTimeout(() => {
      state_set(true);
    }, 0);
  });
  return null;
}

Expected: Message printed 60 times per second.
Got: Message printed 120 times per second, depending on whether state_set was called. When commenting that call, it is 60 times per second again.