Skip to content

Commit 03dcb77

Browse files
committed
Using proptypes
- Using proptypes.
1 parent 5b3bed8 commit 03dcb77

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

package-lock.json

Lines changed: 11 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"postcss-loader": "3.0.0",
4040
"postcss-preset-env": "6.3.1",
4141
"postcss-safe-parser": "4.0.1",
42+
"prop-types": "^15.7.2",
4243
"radium": "^0.25.1",
4344
"react": "16.8.4",
4445
"react-app-polyfill": "^0.2.0",

src/components/Persons/Person/Person.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { Component } from 'react';
22
import Aux from '../../../hoc/Aux';
33
import classes from './Person.css';
44
import withClass from '../../../hoc/withClass';
5+
import PropTypes from 'prop-types';
56

67
class Person extends Component {
78
render() {
@@ -21,4 +22,11 @@ class Person extends Component {
2122
}
2223
};
2324

25+
Person.propTypes = {
26+
click: PropTypes.func,
27+
changed: PropTypes.func,
28+
name: PropTypes.string,
29+
age: PropTypes.number,
30+
};
31+
2432
export default withClass(Person, classes.Person);

0 commit comments

Comments
 (0)