diff --git a/package.json b/package.json index 674553e..4d8257d 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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": { @@ -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", @@ -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" } diff --git a/src/index.js b/src/index.js index 7104a60..75895d3 100644 --- a/src/index.js +++ b/src/index.js @@ -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); diff --git a/yarn.lock b/yarn.lock index ccde2ee..94b8e64 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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: