setState method

void setState(
  1. FlintStateUpdater update, {
  2. bool render = true,
})

Applies update and schedules this component to render again.

Pass render: false when the state change is intentionally internal and should not repaint the DOM, such as mirroring raw input text that is already visible in the focused control.

Implementation

void setState(FlintStateUpdater update, {bool render = true}) {
  update();
  if (!render) return;
  _scheduleRender?.call();
}