Toggle: wrong types on values and events
krzysztofwolski opened this issue · 0 comments
krzysztofwolski commented
<Toggle
defaultValue={value.toString()} // toggle expects value as string
value={value.toString()} // the same here
onPressedChange={(x) => {
console.log("changed", x); // the type of the value in this callback is `number`
}}
>
<Text>Enabled</Text>
</Toggle>
Types of the value
and onPressedChange
should probably be the same.