umi-examples
umi-examples copied to clipboard
examples for umi.js
``` const page: FC = function(props) { const handleAdd = () => { props.dispatch(add()); }; const handleMinus = () => { props.dispatch(minus()); }; console.log(props.xxx) // 这里props里面并没有xxx属性,ts编译却通过了 return ( ); };...
## 操作步骤: 1. `git clone https://github.com/umijs/umi-examples.git` 2. `cd umi-examples/with-dva` 3. `yarn && yarn start` ## 报错截图:  ## 解决: 将几处的`routing`修改为`router`后正常运行
复现步骤: 1. git clone umi-examples 2. cd with-fusion-next 2. tnpm i 3. umi dev; 备注: node version: v10.15.3 umi version: 2.9.3 
空值检查
我希望umi可以对null值做严格的测试(不要给对象赋值null!编译的时候就报错)。demo如下: 1. 测试代码: ``` it("test null check", () => { let name:string = null expect(name).toBe(null) }) ``` 2. tsconfig.json "strictNullChecks": true 3. test命令 `umi test`
## Cannot destructure ROUTES_MODIFIER in runtime-routes-update ### Problem Throws error saying ROUTES_MODIFER cannot be destructed because it's null/undefined. ### Potential Fix? I solved this by changing: https://github.com/umijs/umi-examples/blob/7e9d5bc3344ecf564aa2bc451e1444ec159bf465/runtime-routes-update/updateRoutes.plugin.js#L5 to: `const {...
 在windows平台下执行npm run dev会报错,看了下.umi下的umi.js文件:  生成的路径不能识别,应该是node中处理windows和linux的路径分隔符不同导致的。 暂时先将umi-plugin-entry.js插件里面的 `api.modifyEntryRender(memo => { memo = `const rootContainer = window.g_plugins.apply('rootContainer', { initialValue: React.createElement(require('${join(__dirname, "./redux/index")}').default, null, React.createElement(require('./router').default),), });` 替换成了相对路径: `api.modifyEntryRender(memo => { memo = `const...
在配置路由中可以在 `path` 里使用正则实现,那约定式路由如何实现呢? 配置路由的动态路由匹配模式:[issues2272](https://github.com/umijs/umi/issues/2272#issuecomment-483476727)
先收录参考,考虑需要不需要提供一个关于动画比较完整的例子 https://web-animations.github.io/web-animations-demos/#phone/ https://github.com/react-component/animate