Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,12 @@ react dialog component
```js
var Dialog = require('rc-dialog');

React.renderComponent(
(<Dialog title={title} onClose={callback1} onShow={callback2}>
<p>first dialog</p>
</Dialog>),
document.getElementById('t1')
);

ReactDOM.render(
<Dialog title={title} onClose={callback1} onShow={callback2}>
<p>first dialog</p>
</Dialog>
), document.getElementById('t1'));

// use dialog
```

Expand Down Expand Up @@ -151,4 +150,4 @@ http://localhost:8007/node_modules/rc-server/node_modules/node-jscover/lib/front

## License

rc-dialog is released under the MIT license.
rc-dialog is released under the MIT license.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
],
"dependencies": {
"object-assign": "4.x",
"rc-align": "1.x",
"rc-animate": "1.x",
"rc-align": "2.x",
"rc-animate": "2.x",
"rc-util": "2.x"
}
}
9 changes: 5 additions & 4 deletions tests/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ var Dialog = require('../index');
require('../assets/bootstrap.less');
var $ = require('jquery');
var React = require('react');
var ReactDOM = require('react-dom');
var TestUtils = require('react-addons-test-utils');
var Simulate = TestUtils.Simulate;
var async = require('async');
Expand All @@ -29,7 +30,7 @@ describe('dialog', function () {
}

callback1 = 0;
dialog = React.render((<Dialog
dialog = ReactDOM.render((<Dialog
style={{width: 600}}
title={title}
onClose={onClose}>
Expand All @@ -38,7 +39,7 @@ describe('dialog', function () {
});

afterEach(function () {
React.unmountComponentAtNode(container);
ReactDOM.unmountComponentAtNode(container);
});

it('show', function (done) {
Expand Down Expand Up @@ -113,7 +114,7 @@ describe('dialog', function () {
});

it('renderToBody', function () {
var d = React.render(<Dialog>
var d = ReactDOM.render(<Dialog>
<p className="renderToBody">1</p>
</Dialog>, container);
expect($('.renderToBody').length).to.be(0);
Expand All @@ -125,7 +126,7 @@ describe('dialog', function () {
expect($('.renderToBody').length).to.be(1);
expect($('.rc-dialog-wrap')[0].parentNode).not.to.be(container);
expect($('.rc-dialog-wrap')[0].parentNode.className).to.be('rc-dialog-container');
React.unmountComponentAtNode(container);
ReactDOM.unmountComponentAtNode(container);
expect($('.renderToBody').length).to.be(0);
expect($('.rc-dialog-container').length).to.be(0);
});
Expand Down