Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to format code by docs plugin #9146

Closed
Binbiubiubiu opened this issue Dec 13, 2019 · 1 comment
Closed

How to format code by docs plugin #9146

Binbiubiubiu opened this issue Dec 13, 2019 · 1 comment

Comments

@Binbiubiubiu
Copy link

Binbiubiubiu commented Dec 13, 2019

Describe the bug
Code preview format is messed up

To Reproduce
Steps to reproduce the behavior:
use Typescript

 config.module.rules.push({
    test: /\.(ts|tsx)$/,
    use: [
      {
        loader: require.resolve('awesome-typescript-loader'),
        options: {
          transpileOnly: true,
        },
      },
       {
         loader: require.resolve('react-docgen-typescript-loader'),
         options: {
           tsconfigPath: path.resolve(__dirname, '../tsconfig.json'),
         },
       },
    ],
  });

preset config

 {
    name: '@storybook/addon-docs/react/preset',
    options: {
      configureJSX: true,
      babelOptions: {},
      sourceLoaderOptions:null
    },
  },

Expected behavior
Format properly code preview
Official code snippet format
image

image

Screenshots
image

Code snippets

<Preview >
  <Story name="default">
    <Radio.Group value="apple">
      <Radio label="apple" />
      <Radio label="banana" />
      <Radio label="watermale" />
    </Radio.Group>
  </Story>
</Preview>

System:
yarn add -D @storybook/addon-docs

Additional context
Add any other context about the problem here.

@Binbiubiubiu
Copy link
Author

sorry my fault!!!! upgrade version 5.3.0 is ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants