NativeBase: TypeError: null is not an object (evaluating 'this.toastInstance._root.showToast')
Using “native-base”: “^2.3.3”
My App:
const Client = () => (
<ApolloProvider client={client}>
<I18nextProvider i18n={i18next}>
<Root>
<App />
</Root>
</I18nextProvider>
</ApolloProvider>
);
export default Client;
Using android. The case happens when a i started my app, click in back button until minimize the app, then open app, after this, happens the error.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 2
- Comments: 30 (2 by maintainers)
Ok - I’m getting this same error with
native-base v2.12.1and I do have<Root>as my top-level component (@roadev fyi my<Root>is wrapping my redux<Provider>component).Happens both on Android and iOS devices.
Fixed with 2.5.0
Wrapping the component in
<Root>will do the trick.<Root>will be imported fromnative-baseI have reproduced the same issue.
Steps to reproduce
react-native run-android.Screenshot of emulator
package.json
Same here @2.4.3
Edit: Setting toastInstance to null on willMount or willUnmount does the trick for me (See https://github.com/GeekyAnts/NativeBase/issues/739):
I see the same issue too. I’m on
"native-base": "^2.12.1".Rootis my top level component.We’re having the same issue as @grahammcculloch. Maybe this issue should be reopened?
I’m getting the error in v2.8.1 I have my components wrapped inside
<Root>I am also seeing the same issue with v2.13.8. My top level component is already wrapped with
<Root>. I am seeing this only when I go back in react navigation stack to the component where Toast is being used.Same issue with
native-base v2.12.0. So far only on Android 8+. Here is the top level render method: