Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 IE11 中收到以下错误Assignment to read only properties is not allowed in strict mode。深入挖掘后,看起来该错误位于 ReactCSSTransitionGroup 的源代码中。该组件在其他浏览器中呈现良好。思考它可能是什么?
Assignment to read only properties is not allowed in strict mode
以上可能是图书馆的限制;我没有对此进行详细调查,但对我来说,它似乎更多地围绕着渲染/解释引擎行为。
我的代码中出现了同样的错误,但它与 IE 如何处理元素渲染有关。上面的代码行尝试将 添加className到现有元素。但是,在 IE 中,某些元素被解释为只读,因此类分配代码会抛出错误;就我而言,它试图将classNameIE 中不允许的 SVG 元素设置为。因此,我必须将我的元素包装进去<div>,然后一切正常。
className
<div>
希望这可以帮助!!!