Addon-docs: Show code by default

This commit is contained in:
Fabien Rassinier 2021-04-27 11:31:08 +02:00
parent 1c4e048c5a
commit f517a0a37d
2 changed files with 9 additions and 2 deletions

View File

@ -57,7 +57,9 @@ const getPreviewProps = (
return { return {
...props, // pass through columns etc. ...props, // pass through columns etc.
withSource: sourceProps, withSource: sourceProps,
isExpanded: withSource === SourceState.OPEN, isExpanded: withSource
? withSource === SourceState.OPEN
: docsContext?.parameters?.docs?.isExpanded,
}; };
}; };

View File

@ -29,7 +29,12 @@ export default {
}, },
}, },
}, },
parameters: { chromatic: { disable: true } }, parameters: {
docs: {
isExpanded: false,
},
chromatic: { disable: true },
},
}; };
const DEFAULT_NESTED_OBJECT = { a: 4, b: { c: 'hello', d: [1, 2, 3] } }; const DEFAULT_NESTED_OBJECT = { a: 4, b: { c: 'hello', d: [1, 2, 3] } };