TypeError: Cannot read property 'show' of null
See original GitHub issueWhen I show a toast and navigate to a screen and when I go back to the screen where I showed the toast the Toast.show() function shows me TypeError: Cannot read property ‘show’ of null
Code:
try {
setMessageToast(
'Estamos enviado um e-mail para você contendo um código de autorização',
);
Toast.show({
type: 'success',
topOffset: 20,
autoHide: false,
});
} catch (err) {
console.log(err);
}
await AsyncStorage.mergeItem('@storage_signup', data);
const responseData = await AsyncStorage.getItem('@storage_signup');
const result = responseData && JSON.parse(responseData);
await api.post('/users/auth-signup', {
fullname: result.fullname,
nickname: result.nickname,
email: result.email,
});
Toast.hide();
navigation.navigate('SignUp4');
All of the above code is inside a try catch
Remembering that the toast is displayed only once, only after a while it is displayed again without the mentioned error
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Uncaught TypeError: Cannot read property of null - iDiallo
This error occurs when you read a property or call a method on a null object . That's because the DOM API returns...
Read more >TypeError: Cannot read property 'value' of Null in JS
To solve the "Cannot read property 'value' of null" error, make sure that the JS script tag is placed at the bottom of...
Read more >Getting error "Cannot read property 'show' of null" in console ...
I have been trying to setup some jQuery to so that the image shows when the link is rolled over. Here is the...
Read more >How to deal with TypeError: cannot read properties of null
While coding in Javascript, you must have at least once received a Type Error which has the message “cannot read properties of null”....
Read more >typeerror can not read property x of null - YouTube
Join this channel to get access to perks:https://www.youtube.com/channel/UCoSpmr2KNOxjwE_B9ynUmig/joinMy GearCamera ...
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 Free
Top 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
I have same issue in my Android app on production, but not on iOS (!)
App crashes with several hundred a day and it’s depressing. Unfortunately I am unable to reproduce this issue as write @Victorcassiano and it does not seem to occur on all devices.
Same issue. Simple stuff like this, doesn’t work. Fails with the error
TypeError: Cannot read property 'show' of null, js engine: hermes