Closed maxammann closed 3 years ago
Couldn't find version numbers for the following packages in the issue:
react-native
react-native-vector-icons
Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.
The versions mentioned in the issue for the following packages differ from the latest versions on npm:
react-native
(found: 0.63.3
, latest: 0.63.4
)Can you verify that the issue still exists after upgrading to the latest versions of these packages?
Hello 👋, this issue has been open for more than 2 months with no activity on it. If the issue is still present in the latest version, please leave a comment within 7 days to keep it open, otherwise it will be closed automatically. If you found a solution on workaround for the issue, please comment here for others to find. If this issue is critical for you, please consider sending a pull request to fix the issue.
Still happening: null
is logged but type it not nullable:
@Trancever should this be closed? Not sure who to contact :man_shrugging:
Current behaviour
onValueChange in ToggleButton.Group is called with
null
Expected behaviour
I think it is fine to call it with null. In that case the TypeScript types need to be changed. We could also introduce a
defaultValue
prop which is used when no toggle button is selected.Code sample
[Snack](https://snack.expo.io/i5_NrJH5x?name=ToggleButton.Group&description=https%3A%2F%2Fcallstack.github.io%2Freact-native-paper%2Ftoggle-button-group.html&code=import%20*%20as%20React%20from%20%27react%27%3B%0Aimport%20{%20ToggleButton%20}%20from%20%27react-native-paper%27%3B%0A%0Aconst%20MyComponent%20%3D%20()%20%3D%3E%20{%0A%20%20const%20[value%2C%20setValue]%20%3D%20React.useState(%27left%27)%3B%0A%0A%20%20return%20(%0A%20%20%20%20%3CToggleButton.Group%0A%20%20%20%20%20%20onValueChange%3D{value%20%3D%3E%20setValue(value)}%0A%20%20%20%20%20%20value%3D{value}%3E%0A%20%20%20%20%20%20%3CToggleButton%20icon%3D%22format-align-left%22%20value%3D%22left%22%20%2F%3E%0A%20%20%20%20%20%20%3CToggleButton%20icon%3D%22format-align-right%22%20value%3D%22right%22%20%2F%3E%0A%20%20%20%20%3C%2FToggleButton.Group%3E%0A%20%20)%3B%0A}%3B%0A%0Aexport%20default%20MyComponent%3B&dependencies=react-native-paper)
Your Environment