Skip to content

Commit

Permalink
Merge pull request #53 from kadirahq/fix-proptables-option
Browse files Browse the repository at this point in the history
Handle propTables=false properly
  • Loading branch information
Muhammed Thanish authored Aug 11, 2016
2 parents e2bf9c0 + 7d235fb commit d85d261
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Story.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export default class Story extends React.Component {
_getPropTables() {
const types = new Map();

if (this.props.propTables === false) {
if (this.props.propTables === null) {
return null;
}

Expand Down
7 changes: 7 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ export default {
..._options
};

// props.propTables can only be either an array of components or null
// propTables option is allowed to be set to 'false' (a boolean)
// if the option is false, replace it with null to avoid react warnings
if (!options.propTables) {
options.propTables = null;
}

this.add(storyName, (context) => {
const props = {
info,
Expand Down

0 comments on commit d85d261

Please sign in to comment.