akveo / react-native-ui-kitten

:boom: React Native UI Library based on Eva Design System :new_moon_with_face::sparkles:Dark Mode
https://akveo.github.io/react-native-ui-kitten/
MIT License
10.32k stars 953 forks source link

Warning when onSelect Menu: state updates from the useState() and usereducer() hooks don't support the second callback argument #894

Closed mohamed-alashry closed 4 years ago

mohamed-alashry commented 4 years ago

🐛 Bug Report

onSelect Menu item throws a React warning: "state updates from the usestate() and usereducer() hooks don't support the second callback argument"

To Reproduce

just selecting any item throws the warning

<Menu data={data} selectedIndex={selectedIndex} onSelect={setSelectedIndex} />

UI Kitten and Eva version

Package Version
@eva-design/eva 1.4.0
@ui-kitten/components 4.4.0
artyorsh commented 4 years ago
<Menu 
  data={data}
  selectedIndex={selectedIndex}
  onSelect={index => setSelectedIndex(index)}
/>