Skip to content
This repository has been archived by the owner on Aug 10, 2019. It is now read-only.

Commit

Permalink
feat(prop types): Add prop types to project for typechecking
Browse files Browse the repository at this point in the history
  • Loading branch information
tvthatsme committed Jun 4, 2018
1 parent edbd064 commit 0262f58
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "react-power-picture",
"version": "0.0.0-development",
"description": "A React component for rendering images both resposively and progressively",
"description":
"A React component for rendering images both resposively and progressively",
"keywords": [
"react",
"responsive",
Expand Down Expand Up @@ -31,7 +32,7 @@
"license": "MIT",
"peerDependencies": {
"react": "^15.0.0-0 || ^16.0.0-0",
"react-dom": "^15.0.0-0 || ^16.0.0-0"
"prop-types": "^15.6.1"
},
"sideEffects": false,
"devDependencies": {
Expand All @@ -45,6 +46,7 @@
"coveralls": "^3.0.1",
"cz-conventional-changelog": "^2.1.0",
"gh-pages": "^1.1.0",
"prop-types": "^15.6.1",
"react": "^16.4.0",
"react-dom": "^16.4.0",
"react-scripts": "^1.1.4",
Expand All @@ -58,9 +60,7 @@
"semantic-release": "^15.5.0",
"travis-deploy-once": "^5.0.0"
},
"files": [
"dist"
],
"files": ["dist"],
"czConfig": {
"path": "node_modules/cz-conventional-changelog"
}
Expand Down
12 changes: 12 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';

class PowerPicture extends Component {
static propTypes = {
sources: PropTypes.arrayOf(
PropTypes.shape({
src: PropTypes.string,
size: PropTypes.number
})
).isRequired,
onError: PropTypes.func,
children: PropTypes.func
};

constructor(props) {
super(props);

Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6775,7 +6775,7 @@ promise@^7.1.1:
dependencies:
asap "~2.0.3"

prop-types@^15.5.10, prop-types@^15.6.0:
prop-types@^15.5.10, prop-types@^15.6.0, prop-types@^15.6.1:
version "15.6.1"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.1.tgz#36644453564255ddda391191fb3a125cbdf654ca"
dependencies:
Expand Down

0 comments on commit 0262f58

Please sign in to comment.