Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Typograhy.Text component use ReactDom.render promotes console error #2699

Open
1 task done
SijieCai opened this issue Feb 8, 2025 · 4 comments · May be fixed by #2700
Open
1 task done

[BUG] Typograhy.Text component use ReactDom.render promotes console error #2699

SijieCai opened this issue Feb 8, 2025 · 4 comments · May be fixed by #2700

Comments

@SijieCai
Copy link

SijieCai commented Feb 8, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Which Component

Typograhy.Text

Semi Version

2.73.0

Current Behavior

I'm using React 18, when use Text component with fixed width, it will log an annoying error: Warning: ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot

Expected Behavior

No error

Steps To Reproduce

I think the source code explains everything, check typography/util.es,
it use ReactDOM.render(/*#__PURE__*/React.createElement(React.Fragment, null), ellipsisContainer); to calculate if width are exceed limit, I think it could be done without using ReactDOM.render here.

ReproducibleCode

Environment

Anything else?

No response

@YyumeiZhang
Copy link
Collaborator

The use of ReactDOM.render in typography can be removed。

@YyumeiZhang
Copy link
Collaborator

@DaiQiangReal See how to modify the use of ReactDOM.render in Modal, Toast, and Notification?

@DaiQiangReal
Copy link
Collaborator

@DaiQiangReal See how to modify the use of ReactDOM.render in Modal, Toast, and Notification?

#938 (comment)

@DaiQiangReal
Copy link
Collaborator

目前暂定的解决方案是在同一个包里发两个入口文件的 semi ,待后续进行 react19 改造的时候再详细讨论

@DaiQiangReal See how to modify the use of ReactDOM.render in Modal, Toast, and Notification?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants