Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ariesbrylle-bms opened this issue Nov 12, 2020 · 8 comments
Closed

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

ariesbrylle-bms opened this issue Nov 12, 2020 · 8 comments

Comments

@ariesbrylle-bms
Copy link

ariesbrylle-bms commented Nov 12, 2020

Here's my code in app.js

`const App = createAppContainer(switchNavigator);

export default () => {
return (

<Toast ref={(ref) => Toast.setRef(ref)} />
<App
ref={(navigator) => {
setNavigator(navigator);
}}
/>

);
};`

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 👋", });

....

@moussouba
Copy link

moussouba commented 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

@ariesbrylle-bms
Copy link
Author

will try. Thank you.

@ariesbrylle-bms
Copy link
Author

zsh: command not found: yarn

That's the error I received. Will there be a problem if I'm using npm then switch to yarn?

@moussouba
Copy link

install yarn through this link

@ariesbrylle-bms
Copy link
Author

Hello, I was able to use yarn instead of npm. I will now close this issue. Thank you very much for your help.

@rogerkerse
Copy link

This issue still exists with more common npm install so its not a viable solution

@calintamas
Copy link
Owner

With @rogerkerse's contribution, published the fix in v1.3.5

@AshotN
Copy link

AshotN commented 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')]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants