Skip to content

Fixed PropTypes deprecation of React 15.5 #57

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions modules/Media.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import PropTypes from 'prop-types'
import React from 'react'
import json2mq from 'json2mq'

const queryType = PropTypes.oneOfType([
Expand All @@ -12,6 +13,7 @@ const queryType = PropTypes.oneOfType([
*/
class Media extends React.Component {
static propTypes = {
defaultMatches: PropTypes.bool,
query: queryType,
queries: PropTypes.objectOf(queryType),
render: PropTypes.func,
Expand Down Expand Up @@ -68,7 +70,7 @@ class Media extends React.Component {

if (queries) {
queries = Object.keys(queries).map(mq => ({
name: mq,
name: mq,
qs: json2mq(queries[mq]),
}))
this.queries = queries.map(mq => ({
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"react": ">=15 || ^0.14.7"
},
"dependencies": {
"json2mq": "^0.2.0"
"json2mq": "^0.2.0",
"prop-types": ">=15"
},
"devDependencies": {
"babel-cli": "^6.11.4",
Expand Down