React Native Storybook - 未加载插件

React Native Storybook - No addons loaded

提问人:Harinony 提问时间:11/17/2023 更新时间:11/17/2023 访问量:9

问:

我已经在我的 React Native 项目中实现了 Storybook,除了插件之外,一切似乎都运行正常——它们没有加载。有人可以帮助我解决这个问题并正确加载插件吗?

故事是这样的:

import { ComponentMeta, ComponentStory } from '@storybook/react-native';

import { Text } from './Text';

const TextMeta: ComponentMeta<typeof Text> = {
  title: 'Text',
  component: Text,
  args: {
    color: 'red',
  },
  argTypes: {
    color: {
      options: ['red', 'blue', 'green'],
      control: { type: 'radio' },
    },
  },
};

export default TextMeta;

type TextStory = ComponentStory<typeof Text>;

export const Primary: TextStory = args => <Text {...args}> Hello World </Text>;

和主.js

const config = {
  stories: ['../src/app/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
  addons: [
    '@storybook/addon-ondevice-actions',
    '@storybook/addon-ondevice-backgrounds',
    '@storybook/addon-ondevice-controls',
    '@storybook/addon-ondevice-notes',
  ],
  framework: {
    name: '@storybook/react-native',
    options: {},
  },
};

export default config;

这就是它的外观,在此处输入图像描述

react-native 故事书 storybook-addon

评论


答: 暂无答案