Skip to content

Commit

Permalink
feat(ToastContainer): toastMessageClass changed to toastMessageFactory
Browse files Browse the repository at this point in the history
BREAKING CHANGE: propTypes renamed to toastMessageFactory

toastMessageFactory now only accepts the result of calling React.createFactory(ReactElementClass).
  • Loading branch information
tomchentw committed Oct 29, 2014
1 parent 4b5d2c4 commit bdcbaba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions client/scripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require("../styles/index.scss");
var React = require("react/addons");
var ReactToastr = require("../../src");
var {ToastContainer} = ReactToastr;
var ToastMessage = React.createFactory(ReactToastr.ToastMessage.jQuery);
var ToastMessageFactory = React.createFactory(ReactToastr.ToastMessage.jQuery);

var Body = React.createClass({
addAlert () {
Expand All @@ -19,7 +19,7 @@ var Body = React.createClass({

render: function() {
return <div id="react-root">
<ToastContainer toastMessageClass={ToastMessage} ref="container" className="toast-top-right" />
<ToastContainer toastMessageFactory={ToastMessageFactory} ref="container" className="toast-top-right" />

<h1>
React-Toastr
Expand Down
6 changes: 3 additions & 3 deletions src/ToastContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
var React = require("react/addons");
var {update} = React.addons;

var ToastMessage = require("./ToastMessage");
var ToastMessage = React.createFactory(require("./ToastMessage"));

function noop () {}

Expand Down Expand Up @@ -42,7 +42,7 @@ module.exports = React.createClass({
warning: "warning"
},
id: "toast-container",
toastMessageClass: ToastMessage,
toastMessageFactory: ToastMessage,
preventDuplicates: false,
newestOnTop: true,
onClick: noop
Expand Down Expand Up @@ -115,7 +115,7 @@ module.exports = React.createClass({
_render (props, state) {
return <div {...props} aria-live="polite" role="alert">
{state.toasts.map((toast) => {
return props.toastMessageClass(toast);
return props.toastMessageFactory(toast);
})}
</div>;
}
Expand Down

0 comments on commit bdcbaba

Please sign in to comment.