注释useState可以防止IE11崩溃

问题描述 投票:-1回答:1

我上传了a repository

[dist/index.htm导致IE11崩溃,如下所示。

无法获得未定义或空引用的属性'root']

// inner.jsx
import { Grid } from '@material-ui/core';
import React, { useState } from 'react';

export function Inner() {
  var [path] = useState(''); // <- why commenting this prevents crash?
  return <Grid container></Grid>;
}

但是在var [path] = useState('')中注释src/inner.jsx并运行npm run publish后,不会发生崩溃。我不明白结果。

是虫子吗?如果是的话,我应该在哪里提出问题?

我上传了一个存储库。 dist / index.htm导致IE11崩溃,如下所示。无法获取未定义或空引用的属性“ root” // //从'@ material-ui / core'中导入inner.jsx import {Grid} ...

javascript reactjs material-ui babel core-js
1个回答
0
投票

useBuiltIns: 'usage'更改为useBuiltIns: 'entry'可解决IE11的问题。

© www.soinside.com 2019 - 2024. All rights reserved.