null is not an object (evaluating 'this._ref.show')
See original GitHub issueHere’s my code in app.js
`const App = createAppContainer(switchNavigator);
export default () => { return ( <AuthProvider> <Toast ref={(ref) => Toast.setRef(ref)} /> <App ref={(navigator) => { setNavigator(navigator); }} /> </AuthProvider> ); };`
Here’s my code on my login.js that uses notification.
const LoginScreen = ({ navigation }) => { // initialized Auth Context Toast.show({ text1: "Hello", text2: "This is some something 👋", });
…
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
undefined is not an object (evaluating 'this.refs.loaderRef.hide')
This simply means that loaderRef is null, check you are initialising loaderRef properly. Also check that, this will return you current ...
Read more >How to Fix TypeError: Null is Not an Object in JavaScript
The JavaScript error TypeError: null is not an object occurs when a property is accessed or a method is called on a null...
Read more >TypeError: null is not an object (evaluating 'f.focus')
This error occurs when you read a property or call a method on a null object .
Read more >Undefined is not an object (evaluating '_this.refs.toast.show) #45
I tried this and it's work for me: Define in constructor this.toast = null. set the ref <Toast ref={ref => { this.toast =...
Read more >TypeError: null is not an object - Laracasts
Currently I get an error of "TypeError: null is not an object (evaluating 'this.booking.id')" .
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi guy, uninstall with
npm uninstall react-native-toast-message
and reinstall withyarn add react-native-toast-message
it work for meI’m still getting this error but the toasts work. Any ideas?
[Unhandled promise rejection: TypeError: null is not an object (evaluating 'Toast._ref.show')]