我试图用弹出版本的create-react-app设置React故事书。
// config.js
import { configure } from '@storybook/react';
import i18n from 'i18n';
import { I18nextProvider } from 'react-i18next';
const Root = story => (
<I18nextProvider i18n={i18n}>
<App {...rest} />
</I18nextProvider>
);
function loadStories() {
require('../src/components/Home/Slip/Slip.story.js');
// You can require as many stories as you need.
}
configure(loadStories, module);
以下是故事:
import _ from 'lodash';
import React from 'react';
import { storiesOf } from '@storybook/react';
import Slip from './Slip.component';
const data = {...}
storiesOf('Footer', module).add('with text', () => (
<Slip data={data} />
));
我得到
有人可以帮我吗?