Skip to content

Commit

Permalink
Merge pull request #3 from rikuson/change-proptypes-for-latest-react
Browse files Browse the repository at this point in the history
Change PropTypes for latest React
  • Loading branch information
raythree authored Aug 9, 2017
2 parents a92fadb + f2ea6dd commit 8e869b2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"babel-cli": "^6.11.4",
"babel-preset-es2015": "^6.9.0",
"babel-preset-react": "^6.11.1",
"prop-types": "^15.5.10",
"rimraf": "^2.5.4"
}
}
7 changes: 4 additions & 3 deletions src/ThemeChooser.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';

function capitalize(s) {
return s.charAt(0).toUpperCase() + s.substring(1);
Expand Down Expand Up @@ -51,9 +52,9 @@ class ThemeChooser extends React.Component {
}

ThemeChooser.contextTypes = {
themeSwitcher: React.PropTypes.object,
themes: React.PropTypes.array,
currentTheme: React.PropTypes.string
themeSwitcher: PropTypes.object,
themes: PropTypes.array,
currentTheme: PropTypes.string
};

export { ThemeChooser };
15 changes: 8 additions & 7 deletions src/ThemeSwitcher.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';
import Lazyloader from './lazyloader';

function setItem(key, obj) {
Expand Down Expand Up @@ -123,16 +124,16 @@ class ThemeSwitcher extends React.Component {
}

ThemeSwitcher.childContextTypes = {
themeSwitcher: React.PropTypes.object,
themes: React.PropTypes.array,
currentTheme: React.PropTypes.string
themeSwitcher: PropTypes.object,
themes: PropTypes.array,
currentTheme: PropTypes.string
};

ThemeSwitcher.propTypes = {
themePath: React.PropTypes.string,
defaultTheme: React.PropTypes.string,
storeThemeKey: React.PropTypes.string,
themes: React.PropTypes.array
themePath: PropTypes.string,
defaultTheme: PropTypes.string,
storeThemeKey: PropTypes.string,
themes: PropTypes.array
};

ThemeSwitcher.defaultProps = {
Expand Down

0 comments on commit 8e869b2

Please sign in to comment.