Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation warnings #14

Merged
merged 3 commits into from
May 6, 2017
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
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ This simulates a light switch that takes `5000ms` to switch between `on` and `!o

```javascript
import ReactTimeout from 'react-timeout'
import createReactClass from 'create-react-class';

var Example = React.createClass({
var Example = createReactClass({
toggleOn: function () {
this.setState({ on: !this.state.on })
},
Expand Down Expand Up @@ -100,7 +101,7 @@ class Example extends Component { .. }

```javascript
@ReactTimeout
var Example = React.createClass({ .. })
var Example = createReactClass({ .. })
```

# Something similar
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"test": "mocha --compilers js:babel-core/register --require ./test/helper.js 'test/**/*.@(js|jsx)'"
},
"dependencies": {
"create-react-class": "^15.5.2",
"object-assign": "^4.0.1"
},
"devDependencies": {
Expand All @@ -39,7 +40,6 @@
"jsdom": "^10.1.0",
"mocha": "^3.2.0",
"react": "^15.4.2",
"react-addons-test-utils": "^15.4.2",
"react-dom": "^15.4.2"
}
}
3 changes: 2 additions & 1 deletion src/reactTimeout.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
var createReactClass = require('create-react-class')
var objectAssign = require('object-assign')

var createReactTimeout = function (React) {
Expand Down Expand Up @@ -52,7 +53,7 @@ var createReactTimeout = function (React) {
}

var ReactTimeout = function (SourceComponent) {
return React.createClass({
return createReactClass({
displayName: 'ReactTimeout',

setTimeout: _setTimeout,
Expand Down
2 changes: 1 addition & 1 deletion test/functions.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from 'react'
import { renderIntoDocument, scryRenderedDOMComponentsWithClass } from 'react-addons-test-utils'
import { renderIntoDocument, scryRenderedDOMComponentsWithClass } from 'react-dom/test-utils'
import { expect } from 'chai'

import ReactTimeout from '..'
Expand Down
2 changes: 1 addition & 1 deletion test/timing.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from 'react'
import { render, unmountComponentAtNode } from 'react-dom'
import { Simulate, renderIntoDocument, scryRenderedDOMComponentsWithClass } from 'react-addons-test-utils'
import { Simulate, renderIntoDocument, scryRenderedDOMComponentsWithClass } from 'react-dom/test-utils'
import { expect } from 'chai'

import ReactTimeout from '..'
Expand Down