react-native-switch-selector
react-native-switch-selector copied to clipboard
Initial value is not set properly
Reading the values from the useState() - the initial
value has never been set properly and the selected item is always -1.
Does anything have to be configured?
@dzaiats You need to put your initial state in the useState function, or pass a initial value directly. Can you put some example of your code here?
Hi @jkdrangel , I mean, that even when I change initial={1}
directly in the code, for example, it is not reflected on UI.
Perhaps, the reason that I use the component as a popup custom modal view. And I see the value through the useEffect
The rest of UI components reflect the values properly on change, but not SwitchSelector
, unfortunately :(
Hello, If the error has been lost from sight, I would like to point out that it still exists. It would be good if it could be fixed. Best thanks
@jkdrangel , could you clarify your suggestion about using useState
? Perhaps provide an example?