typescript - Storybook|React 热重载不工作 v5.1.11
问题描述
就这么简单,热重载根本不起作用,我按照确切的步骤https://storybook.js.org/docs/guides/guide-react/
.storybook/config.js
import { configure } from '@storybook/react';
// automatically import all files ending in *.stories.js
const req = require.context('../stories', true, /\.stories\.js$/);
function loadStories() {
req.keys().forEach(filename => req(filename));
}
configure(loadStories, module);
故事/index.stories.js
import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { linkTo } from '@storybook/addon-links';
import { Button, Welcome } from '@storybook/react/demo';
storiesOf('Welcome', module).add('to Storybasdook', () => <Welcome showApp={linkTo('Button')} />);
storiesOf('Buttasdawon', module)
.add('with text', () => <Button onClick={action('clicasdawked')}>Hello Button</Button>)
.add('with some emoji', () => (
<Button onClick={action('clicked')}>
<span role="img" aria-label="so cool">
</span>
</Button>
));
当我运行yarn storybook
一切正常时,但假设我想更改.add('with some emoji'..
为.add('with some emojiiiiii..'
没有任何更改,我需要重新启动yarn storybook
以查看更改
解决方案
推荐阅读
- function - 使用函数传回返回码记录到控制台和文件
- c# - 如何在我的 .NET 应用安装程序中添加 Microsoft.ACE.OLEDB.12.0?
- laravel - Laravel - 下载 PhpSpreadsheet 而不保存它
- azure-cosmosdb - 有没有办法在 Azure 数据工厂中插入带有嵌套数组的文档?
- haskell - `sum (replicate 5 (max 6.7 8.9))`和`(sum .replicate 5 .max 6.7) 8.9`如何得到相同的结果?
- php - 使用 mysqli 准备好的语句将数据插入数据库中的多个列
- azureservicebus - 是否可以从 U-SQL 脚本向 Azure 服务总线队列或事件中心发送消息?
- java - 创建 Java 模型类
- python - 处理 exec 内部函数以进行符号计算
- javascript - 带有“OR”运算符的三元运算符不起作用?