-
Notifications
You must be signed in to change notification settings - Fork 331
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drop use of React.createClass in project templates and tests
Avoids deprecation warnings in React >= 15.5 Closes #216
- Loading branch information
Showing
12 changed files
with
35 additions
and
40 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import React from 'react' | ||
import React, {Component} from 'react' | ||
import {render} from 'react-dom' | ||
|
||
import Component from '../../src' | ||
import Example from '../../src' | ||
|
||
let Demo = React.createClass({ | ||
class Demo extends Component { | ||
render() { | ||
return <div> | ||
<h1>{{name}} Demo</h1> | ||
<Component/> | ||
<Example/> | ||
</div> | ||
} | ||
}) | ||
} | ||
|
||
render(<Demo/>, document.querySelector('#demo')) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import React from 'react' | ||
import React, {Component} from 'react' | ||
|
||
export default React.createClass({ | ||
export default class extends Component { | ||
render() { | ||
return <div> | ||
<h2>Welcome to React components</h2> | ||
</div> | ||
} | ||
}) | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import React from 'react' | ||
import React, {Component} from 'react' | ||
|
||
export default React.createClass({ | ||
export default class extends Component { | ||
render() { | ||
return <div> | ||
<h2>Welcome to React</h2> | ||
</div> | ||
} | ||
}) | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import React from 'react' | ||
import React, {Component} from 'react' | ||
|
||
let Thing = React.createClass({ | ||
class Thing extends Component { | ||
render() { | ||
return <div className="Thing"> | ||
Thing | ||
</div> | ||
} | ||
}) | ||
} | ||
|
||
export default Thing |
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
6 changes: 3 additions & 3 deletions
6
tests/fixtures/projects/router-app/src/routes/child1/Child1.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import React from 'react' | ||
import React, {Component} from 'react' | ||
|
||
let Child1 = React.createClass({ | ||
class Child1 extends Component { | ||
render() { | ||
return <h2>Child 1</h2> | ||
} | ||
}) | ||
} | ||
|
||
export default Child1 |
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