Skip to content

Commit 07541b3

Browse files
committed
example displaying bug
1 parent 31c160d commit 07541b3

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

examples/basic/app.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ var App = React.createClass({
2727
this.setState({modalIsOpen: false});
2828
},
2929

30+
handleInputChange: function() {
31+
this.setState({foo: 'bar'});
32+
},
33+
3034
render: function() {
3135
return (
3236
<div>
@@ -40,7 +44,7 @@ var App = React.createClass({
4044
<button onClick={this.closeModal}>close</button>
4145
<div>I am a modal</div>
4246
<form>
43-
<input />
47+
<input onChange={this.handleInputChange} />
4448
<input />
4549
<input />
4650
<input />

lib/components/Modal.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ var Modal = module.exports = React.createClass({
5050
ariaAppHider.toggle(props.isOpen, props.appElement);
5151
}
5252
sanitizeProps(props);
53-
this.portal = React.renderComponent(ModalPortal(props), this.node);
53+
console.log('hi');
54+
if (this.portal)
55+
this.portal.setProps(props);
56+
else
57+
this.portal = React.renderComponent(ModalPortal(props), this.node);
5458
},
5559

5660
render: function () {

0 commit comments

Comments
 (0)