一夜之间,我原来工作的反应服务被禁用了。它发生的原因是我的浏览器或反应服务器停止支持这个反应组件“react-selectize”。React-selectize 是一个基于“react-select”的反应组件,并提供了一些额外的功能。DOM 不再为组件更新。一个快速的解决方法是将组件更改为 react-select 并放弃一些功能。
我的问题是,我们没有更新浏览器或任何 npm 包,为什么会在一夜之间发生这种变化?
我还有第二个问题。我尝试使用 chrome 调试器在代码中插入断点,我发现了这条回溯消息:
action FETCH_USER_PENDING @ 16:00:44.155
redux-logger.js:1 prev state {notification: {…}, user: {…}}
redux-logger.js:1 action {type: "FETCH_USER_PENDING"}
redux-logger.js:1 next state {notification: {…}, user: {…}}
localhost/:1 (WEB_PAGE context) Lazy require of webstore.binding did not set the binding field
localhost/:1 (WEB_PAGE context) Lazy require of runtime.binding did not set the binding field
2localhost/:1 Previous API instantiation failed.
redux-logger.js:1 action FETCH_USER_FULFILLED @ 16:00:59.515
redux-logger.js:1 prev state {notification: {…}, user: {…}}
redux-logger.js:1 action {type: "FETCH_USER_FULFILLED", payload: {…}}
redux-logger.js:1 next state {notification: {…}, user: {…}}
localhost/:1 (WEB_PAGE context) extensions::event_bindings:8: Uncaught Natives disabled{<stack trace unavailable>}
localhost/:1 (WEB_PAGE context) extensions::binding:5: Uncaught TypeError: Cannot read property 'Event' of undefined{TypeError: Cannot read property 'Event' of undefined
at extensions::binding:5:38
at extensions::runtime:7:28}
extensions::runtime:7 Uncaught TypeError: Cannot read property 'Binding' of undefined
at extensions::runtime:7
(anonymous) @ extensions::runtime:7
extensions::webstore:7 Uncaught Natives disabled
从我的角度来看,react 在 DOM 中使用了惰性更新机制,并且浏览器在新数据和 ui 之间进行绑定时存在问题。有人可以帮助解密更多信息吗?理想情况下,我正在寻找可以在不更改反应组件的情况下解决此问题的修复程序(也许使用 redux?)。但我对所有解决方案持开放态度。