Skip to content

Commit

Permalink
Add prop type checking
Browse files Browse the repository at this point in the history
  • Loading branch information
sheelah committed Jul 7, 2018
1 parent b4c944b commit 2aa5eba
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
5 changes: 4 additions & 1 deletion package.json
Expand Up @@ -12,5 +12,8 @@
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"devDependencies": {
"prop-types": "^15.6.2"
}
}
}
5 changes: 5 additions & 0 deletions src/App.js
Expand Up @@ -2,6 +2,7 @@ import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import FeedbackForm from './components/FeedbackForm';
import PropTypes from 'prop-types';

class App extends Component {
render() {
Expand All @@ -17,4 +18,8 @@ class App extends Component {
}
}

App.propTypes = {
env: PropTypes.object.isRequired
};

export default App;
5 changes: 5 additions & 0 deletions src/components/FeedbackForm.js
@@ -1,3 +1,4 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';

export default class FeedbackForm extends Component {
Expand Down Expand Up @@ -83,3 +84,7 @@ export default class FeedbackForm extends Component {
);
}
}

FeedbackForm.propTypes = {
env: PropTypes.object.isRequired
};

0 comments on commit 2aa5eba

Please sign in to comment.