-
Notifications
You must be signed in to change notification settings - Fork 257
Closed
Description
The default column doesn't show values coming from default props. I'm using CRA
here.
"react": "^16.12.0",
"react-docgen-typescript": "^1.16.1",
"react-styleguidist": "^10.3.2",
Here is the screenshot:
Here is the code snippet
interface Props {
/**
* Different style modification by passing
* Btn's variant or Parent's class elements.
*/
variants?: string
/**
* Size by default is medium. Blank size is a medium size.
*/
size?: '' | 'xsm' | 'sm' | 'lg' | 'xlg'
/**
* The usage depends on elements structure or scenario.
*/
type?: 'button' | 'submit' | 'reset'
/**
* A callback when button is clicked.
* This will pass an React mouse event.
*/
onClick?: React.MouseEventHandler<Element>
/**
* Any string or HTML element placed inside Btn
*/
children: React.ReactNode | string
/**
* It makes button unclickable if the disabled attribute is active.
*/
disabled?: boolean
}
const defaultProps = {
disabled: false,
type: 'submit',
size: '',
variants: '',
onClick() { }
}
const Btn = ({ variants, size, children, onClick, disabled, type }: Props) => {/* ... */}
Btn.defaultProps = defaultProps
export default Btn
and lastly here's my styleguide.config.js
module.exports = {
propsParser: require('react-docgen-typescript').withDefaultConfig({
propFilter: {
shouldExtractLiteralValuesFromEnum: true,
skipPropsWithoutDoc: false
}
}).parse
}
Metadata
Metadata
Assignees
Labels
No labels