Skip to content

Commit

Permalink
Serialize boolean type only for non-nullable values
Browse files Browse the repository at this point in the history
  • Loading branch information
mshaaban088 committed Apr 16, 2018
1 parent 503c186 commit 2a13294
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/knobs/src/components/types/Boolean.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ BooleanType.propTypes = {
onChange: PropTypes.func,
};

BooleanType.serialize = value => String(value);
BooleanType.serialize = value => (value ? String(value) : null);
BooleanType.deserialize = value => value === 'true';

export default BooleanType;

0 comments on commit 2a13294

Please sign in to comment.