react-native-message-bar: Cannot read property 'hideMessageBarAlert' of undefined
Whenever I trigger an alert nothing seems to happen and I get this:
Possible Unhandled Promise Rejection (id: 0): Cannot read property 'hideMessageBarAlert' of undefined TypeError: Cannot read property 'hideMessageBarAlert' of undefined at Object.module.exports.hideAlert (http://localhost:8081/index.ios.bundle?platform=ios&dev=true:16093:29) at Object.module.exports.showAlert (http://localhost:8081/index.ios.bundle?platform=ios&dev=true:16071:6) at _callee2$ (http://localhost:8081/index.ios.bundle?platform=ios&dev=true:80269:512) at tryCatch (http://localhost:8081/index.ios.bundle?platform=ios&dev=true:5108:30) at GeneratorFunctionPrototype.invoke [as _invoke] (http://localhost:8081/index.ios.bundle?platform=ios&dev=true:5384:12) at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (http://localhost:8081/index.ios.bundle?platform=ios&dev=true:5141:13) at tryCatch (http://localhost:8081/index.ios.bundle?platform=ios&dev=true:5108:30) at invoke (http://localhost:8081/index.ios.bundle?platform=ios&dev=true:5184:12) at http://localhost:8081/index.ios.bundle?platform=ios&dev=true:5229:1 at tryCallTwo (http://localhost:8081/index.ios.bundle?platform=ios&dev=true:2626:1)
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 3
- Comments: 19 (3 by maintainers)
Commits related to this issue
- Merge pull request #7 from Talor-A/success-bar-fix remove red border from success bar — committed to denniszxxc/react-native-message-bar by Talor-A 7 years ago
just ran in to a similar situation but had a loader before rendering which messed things up as well
error
works
@temitope I switched to a different message bar package
I’m having the same issue, does anyone have a good example
@AlmogRnD can you share your code to show where you are getting an error?
@bfarrgaynor nvmnd got it working. i was not correctly rendering to keep the refs. works great now.
I’m having this problem with react-native Navigator. I’m not sure how to resolve.
Version: react-native-message-bar@1.4.1
var MessageBarAlert = require('react-native-message-bar').MessageBar; var MessageBarManager = require('react-native-message-bar').MessageBarManager;… ` componentDidMount: function() {},
componentWillUnmount: function() {
},
render: function() { return ( <View style={gStyles.mainContainer}>
} `
I can successfully get the contents of MessageBarManager and MessageBarAlert when I put them through a console.log in my render function - so I know they are accessible and in scope.