Skip to content

Commit

Permalink
Update from React.createClass to JavaScript classes (#19)
Browse files Browse the repository at this point in the history
* Update example to use Javascript Class

* Update spinner to use JavaScript classes
  • Loading branch information
maikthomas authored and chenglou committed Apr 20, 2017
1 parent 35931a7 commit d57a9f6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions example/component.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import Spinner from '../index.jsx';

const App = React.createClass({
render: function() {
class App extends React.Component {
render() {
const style = {
height: 50,
width: 50,
Expand All @@ -14,6 +14,6 @@ const App = React.createClass({
</div>
);
}
});
};

export default App;
9 changes: 6 additions & 3 deletions index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import React from 'react';

const Spinner = React.createClass({
render: function() {
class Spinner extends React.Component {
constructor(props) {
super(props);
}
render() {
let bars = [];
const props = this.props;

Expand All @@ -24,6 +27,6 @@ const Spinner = React.createClass({
</div>
);
}
});
};

export default Spinner;

0 comments on commit d57a9f6

Please sign in to comment.