Skip to content

Commit

Permalink
Merge pull request #19667 from code-dot-org/es6-lightbulb
Browse files Browse the repository at this point in the history
ES6: Lightbulb.jsx
  • Loading branch information
islemaster committed Jan 2, 2018
2 parents e222345 + b182c07 commit 3f2dd37
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions apps/src/templates/Lightbulb.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,23 @@ const styles = {
}
};

const Lightbulb = React.createClass({

propTypes: {
export default class Lightbulb extends React.Component {
static propTypes = {
shouldAnimate: PropTypes.bool,
count: PropTypes.number,
lit: PropTypes.bool,
size: PropTypes.number,
style: PropTypes.object,
isMinecraft: PropTypes.bool,
},
};

getDefaultProps() {
return {
shouldAnimate: false,
count: 0,
lit: true,
size: 40,
style: {}
};
},
static defaultProps = {
shouldAnimate: false,
count: 0,
lit: true,
size: 40,
style: {}
};

render() {
let bulbDisplay;
Expand Down Expand Up @@ -226,6 +223,4 @@ const Lightbulb = React.createClass({
</svg>
);
}
});

export default Lightbulb;
}

0 comments on commit 3f2dd37

Please sign in to comment.