Rewritten with React as renderer and no global state.