Skip to content
This repository was archived by the owner on Apr 7, 2024. It is now read-only.

Conversation

@sunxd-lab
Copy link

@sunxd-lab sunxd-lab commented Jan 4, 2024

在react18版本,使用BaseTable, 用createRoot方式渲染,App被严格模式包裹时,会导致组件无法正确渲染

import ReactDOM from "react-dom/client";
const root = ReactDOM.createRoot(
  document.getElementById("root") as HTMLElement
);
root.render(
  <React.StrictMode>
    <App />
  </React.StrictMode>
);

由于react18在严格模式下,对于类组件会先调用一次 componentWillUnmount, 导致rootSubscription被取消订阅
image

@CLAassistant
Copy link

CLAassistant commented Jan 4, 2024

CLA assistant check
All committers have signed the CLA.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants