Back to Storybook

React Framework Options Legacy Root Api

docs/_snippets/react-framework-options-legacy-root-api.md

10.3.61.6 KB
Original Source
ts
// Replace your-framework with the framework you are using (e.g., nextjs, react-webpack5)
import type { StorybookConfig } from '@storybook/your-framework';

const config: StorybookConfig = {
  framework: {
    name: '@storybook/your-framework',
    options: {
      legacyRootApi: true,
    },
  },
};

export default config;
js
export default {
  framework: {
    // Replace your-framework with the framework you are using (e.g., nextjs, react-webpack5)
    name: '@storybook/your-framework',
    options: {
      legacyRootApi: true,
    },
  },
};
ts
// Replace your-framework with the framework you are using (e.g., nextjs, react-webpack5)
import { defineMain } from '@storybook/your-framework/node';

const config = defineMain({
  framework: {
    name: '@storybook/your-framework',
    options: {
      legacyRootApi: true,
    },
  },
});

export default config;
<!-- JS snippets still needed while providing both CSF 3 & Next -->
js
// Replace your-framework with the framework you are using (e.g., nextjs, react-webpack5)
import { defineMain } from '@storybook/your-framework/node';

const config = defineMain({
  framework: {
    name: '@storybook/your-framework',
    options: {
      legacyRootApi: true,
    },
  },
});

export default config;