آموزش جاوااسکریپت › انجمن ها › react native › undefined is not a function (evaluating 'navigation.dispatch') › پاسخ به: undefined is not a function (evaluating 'navigation.dispatch')
اکتبر 8, 2018 در 5:07 ب.ظ
#20041
UKbed990
مشارکت کننده
You can also wrap your component with withNavigation function from react-navigation. That will make sure you have valid navigation prop.
JavaScript
1 2 3 4 5 |
import { withNavigation } from react-navigation; ... connect(mapStateToProps, mapDispatchToProps)(withNavigation(SideBar)); |
Alternatively, you may pass this.props.navigation from parent component too.