Skip to content

Commit

Permalink
Merge pull request #2279 from storybooks/fix-background-propType
Browse files Browse the repository at this point in the history
Fix propTypes in addon-background
  • Loading branch information
Hypnosphi committed Nov 9, 2017
2 parents a8dc0fd + 3baba88 commit 16cb94d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions addons/background/src/BackgroundPanel.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import addons from '@storybook/addons';
import EventEmitter from 'events';

import Swatch from './Swatch';

Expand Down Expand Up @@ -118,7 +117,11 @@ BackgroundPanel.propTypes = {
getQueryParam: PropTypes.func,
setQueryParams: PropTypes.func,
}).isRequired,
channel: PropTypes.instanceOf(EventEmitter),
channel: PropTypes.shape({
emit: PropTypes.func,
on: PropTypes.func,
removeListener: PropTypes.func,
}),
};
BackgroundPanel.defaultProps = {
channel: undefined,
Expand Down
7 changes: 5 additions & 2 deletions addons/background/src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';
import EventEmitter from 'events';

import addons from '@storybook/addons';

Expand Down Expand Up @@ -63,7 +62,11 @@ export class BackgroundDecorator extends React.Component {
}
BackgroundDecorator.propTypes = {
backgrounds: PropTypes.arrayOf(PropTypes.object),
channel: PropTypes.instanceOf(EventEmitter),
channel: PropTypes.shape({
emit: PropTypes.func,
on: PropTypes.func,
removeListener: PropTypes.func,
}),
story: PropTypes.func.isRequired,
};
BackgroundDecorator.defaultProps = {
Expand Down

0 comments on commit 16cb94d

Please sign in to comment.