question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

null is not an object (evaluating 'this._ref.show')

See original GitHub issue

Here’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:closed
  • Created 3 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
moussoubacommented, Nov 12, 2020

Hi guy, uninstall with npm uninstall react-native-toast-message and reinstall with yarn add react-native-toast-message it work for me

0reactions
AshotNcommented, Oct 5, 2021

I’m still getting this error but the toasts work. Any ideas? [Unhandled promise rejection: TypeError: null is not an object (evaluating 'Toast._ref.show')]

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found