简体   繁体   English

使用React更新状态不会更新IE9中的DOM

[英]Updating state with React does not update DOM in IE9

I am using React and whenever I update the state of my component, it does not immediately update the view in IE9. 我正在使用React,并且每当我更新组件的状态时,它都不会立即更新IE9中的视图。 I have to scroll the specific dom element out of my view and scroll it back into view to see it update. 我必须从视图中滚动出特定的dom元素,然后再将其滚动回到视图中才能看到它的更新。 This works fine in all other browsers (Safari, Chrome, IE10+, Firefox) 在所有其他浏览器(Safari,Chrome,IE10 +,Firefox)中都可以正常运行

Any idea what is causing this and how I can make it update without having to do this scrolling? 任何想法是什么原因造成的,以及如何在不进行此滚动的情况下进行更新?

For IE-9 you can use like 对于IE-9,您可以使用like

<meta http-equiv="X-UA-Compatible" content="IE=edge">

or you can find same question with solution over here 或者您可以在此处找到解决方案的相同问题

React JS not working with Internet Explorer 9 React JS无法与Internet Explorer 9一起使用

It supports IE9 ,check here 支持IE9,请点击这里

IE supported after IE9 IE9之后支持IE

Found the issue. 找到了问题。 When using a span tag around a state property in ReactJS, IE9 will not update it visually unless right-click selecting the text or scrolling it out of your view and back in. 当在ReactJS的state属性周围使用span标签时,IE9不会以视觉方式对其进行更新,除非右键单击选择文本或将其滚动出视图并返回。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM