Skip to content

Commit

Permalink
Merge pull request #1082 from storybooks/fix-proptypes
Browse files Browse the repository at this point in the history
CHANGE to prop-types package for notes & test-cra
  • Loading branch information
ndelangen committed May 21, 2017
2 parents dd8e861 + c7e676f commit 037ce6a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion addons/notes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"react": "*"
},
"dependencies": {
"babel-runtime": "^6.23.0"
"babel-runtime": "^6.23.0",
"prop-types": "^15.5.10"
},
"optionalDependencies": {
"@types/react": "^15.0.24"
Expand Down
5 changes: 3 additions & 2 deletions addons/notes/src/index.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 addons from '@storybook/addons';

export class WithNotes extends React.Component {
Expand All @@ -14,6 +15,6 @@ export class WithNotes extends React.Component {
}

WithNotes.propTypes = {
children: React.PropTypes.node,
notes: React.PropTypes.string,
children: PropTypes.node,
notes: PropTypes.string,
};
5 changes: 3 additions & 2 deletions addons/notes/src/register.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 addons from '@storybook/addons';

const styles = {
Expand Down Expand Up @@ -58,8 +59,8 @@ export class Notes extends React.Component {
}

Notes.propTypes = {
channel: React.PropTypes.object,
api: React.PropTypes.object,
channel: PropTypes.object,
api: PropTypes.object,
};

// Register the addon with a unique name.
Expand Down
5 changes: 3 additions & 2 deletions examples/test-cra/src/stories/Button.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';

const buttonStyles = {
border: '1px solid #eee',
Expand All @@ -17,8 +18,8 @@ const Button = ({ children, onClick }) => (
);

Button.propTypes = {
children: React.PropTypes.string.isRequired,
onClick: React.PropTypes.func,
children: PropTypes.string.isRequired,
onClick: PropTypes.func,
};

export default Button;

0 comments on commit 037ce6a

Please sign in to comment.