auto-prop-doc
v0.0.1
Published
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Downloads
2
Readme
Storybook + React + TypeScript + Vite
- Configure the
reactDocgenTypescriptOptions
property like this on .storybook/main.ts file:
import type { StorybookConfig } from "@storybook/react-vite";
const config: StorybookConfig = {
stories: [
'../src/**/*.mdx',
'../src/**/*.stories.@(js|jsx|mjs|ts|tsx)',
],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@chromatic-com/storybook",
"@storybook/addon-interactions",
],
framework: {
name: "@storybook/react-vite",
options: {},
},
typescript: {
reactDocgen: 'react-docgen-typescript',
reactDocgenTypescriptOptions: {
//👇 Set shouldExtractLiteralValuesFromEnum to true
shouldExtractLiteralValuesFromEnum: true,
shouldRemoveUndefinedFromOptional: true,
skipChildrenPropWithoutDoc: false,
propFilter: (prop) => (prop.parent ? !/node_modules/.test(prop.parent.fileName) : true)
},
},
};
export default config;