Skip to content

Commit

Permalink
Specified that <ButtonWidget> takes a 'prop' of 'caption' that is of …
Browse files Browse the repository at this point in the history
…type 'string' and is required. From now on, not passing this prop will result in a runtime warning emitted to the JavaScript console.
  • Loading branch information
maratbn committed Aug 5, 2018
1 parent 1f72ad2 commit 7ac6290
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions webpack_in/entry.jsx
Expand Up @@ -6,6 +6,7 @@
console.log("JSX entry logic.");


import PropTypes from 'prop-types';
import React from 'react';
import ReactDOM from 'react-dom';

Expand All @@ -29,6 +30,10 @@ class ButtonWidget extends React.Component {
}
}

ButtonWidget.propTypes = {
caption: PropTypes.string.isRequired
};

class HelloWidget extends React.Component {
render() {
return (
Expand Down

0 comments on commit 7ac6290

Please sign in to comment.