Created
December 12, 2015 05:10
-
-
Save crobinson42/2cb75694e0fbc1aa419f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Warning: React can't find the root component node for data-reactid value `.5.1`. If you're seeing this message, it probably means that you've loaded two copies of React on the page. At this time, only a single copy of React can be loaded at a time.warning @ bundle.js:60215ReactMount.findComponentRoot @ bundle.js:52740ReactMount.findReactNodeByID @ bundle.js:52707getNode @ bundle.js:52190executeDispatch @ bundle.js:44197executeDispatchesInOrder @ bundle.js:44221executeDispatchesAndRelease @ bundle.js:43664executeDispatchesAndReleaseTopLevel @ bundle.js:43675forEachAccumulated @ bundle.js:57576EventPluginHub.processEventQueue @ bundle.js:43880runEventQueueInBatch @ bundle.js:51159ReactEventEmitterMixin.handleTopLevel @ bundle.js:51175handleTopLevelWithoutPath @ bundle.js:51273handleTopLevelImpl @ bundle.js:51253Mixin.perform @ bundle.js:57058ReactDefaultBatchingStrategy.batchedUpdates @ bundle.js:49890batchedUpdates @ bundle.js:55134ReactEventListener.dispatchEvent @ bundle.js:51384 | |
bundle.js:52743 Uncaught TypeError: Cannot read property 'firstChild' of undefinedReactMount.findComponentRoot @ bundle.js:52743ReactMount.findReactNodeByID @ bundle.js:52707getNode @ bundle.js:52190executeDispatch @ bundle.js:44197executeDispatchesInOrder @ bundle.js:44221executeDispatchesAndRelease @ bundle.js:43664executeDispatchesAndReleaseTopLevel @ bundle.js:43675forEachAccumulated @ bundle.js:57576EventPluginHub.processEventQueue @ bundle.js:43880runEventQueueInBatch @ bundle.js:51159ReactEventEmitterMixin.handleTopLevel @ bundle.js:51175handleTopLevelWithoutPath @ bundle.js:51273handleTopLevelImpl @ bundle.js:51253Mixin.perform @ bundle.js:57058ReactDefaultBatchingStrategy.batchedUpdates @ bundle.js:49890batchedUpdates @ bundle.js:55134ReactEventListener.dispatchEvent @ bundle.js:51384 | |
bundle.js:7419 mail.update | |
var React = require('react'); | |
var ReactDOM = require('react-dom'); | |
var Modal = require('react-bootstrap').Modal; | |
var Button = require('react-bootstrap').Button; | |
/** | |
* This is a global listener for an event "Modal.Mail" which will attach this to | |
* the DOM body | |
* | |
*/ | |
var el; | |
el = document.createElement('div'); | |
el.id = "MailModalViewController"; | |
document.getElementsByTagName('body')[0].appendChild(el); | |
if (!eventSky) { throw new Error('MailModalViewController - eventSky is not initialized.'); } | |
else { | |
eventSky.on('Modal.Mail', function (data) { | |
if (data && data.id) { | |
ReactDOM.render(<MailModalViewController id={data.id} />, document.querySelector('#MailModalViewController')); | |
// IT's IMPERATIVE to unmount like so: | |
// ReactDOM.unmountComponentAtNode(el); | |
} | |
else { | |
new Error('MailModalViewController.on() expects a data object with event trigger and got: ' + (typeof data)); | |
} | |
}); | |
} | |
/** | |
* ************************* | |
*/ | |
var MailModalViewController = React.createClass({ | |
displayName : "MailModalViewController", | |
}, | |
closeModal() { | |
ReactDOM.unmountComponentAtNode(document.querySelector('#MailModalViewController')); | |
}, | |
render() { | |
var self = this; | |
var messageView = function () { | |
return ( | |
<Modal onHide={this.closeModal}> | |
<Modal.Header closeButton> | |
<Modal.Title>Message</Modal.Title> | |
</Modal.Header> | |
<Modal.Body> | |
message... | |
</Modal.Body> | |
<Modal.Footer> | |
<Button onClick={this.closeModal}>Close</Button> | |
</Modal.Footer> | |
</Modal> | |
); | |
} | |
}); | |
module.exports = MailModalViewController; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment