there's a little error in the demo, line 6:
const [value, setValue] = useState(0);
should be: const [value, setValue] = useState(init);
or the parameter init could be removed from the component.