[BUG] Custom component unmounting
@Sidiro23 đang làm issue này rồi.
Từ ngày 31/7/2024.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Hi,
I have a React18 project and wanted to make custom react-formio component (code below) but this.container.unmount in detachReact method shows this warning:
Warning: Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition.
is there any way to unmount the element without the warning? (And is react-formio compatible with React 18 overall?)
Thanks.
Code:
export default class Grid extends ReactComponent {
...
...
attachReact(element) {
this.container = createRoot(element)
return this.container.render(
<HistoryRouter history={history}>
<GridComponent {...{ ...this }} />
</HistoryRouter>
)
}
detachReact(element) {
if (element) {
this.container.unmount() // this creates the race condition warning
}
}
}
Environment
- Hosting type
- Form.io
- Local deployment
- Version:
- Formio.js version: 5.0.0-m.3
- Frontend framework: React 18
- Ngôn ngữ chính
- TypeScript
- Star
- 371
- Fork
- 309
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của formio/react
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 64/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
-
onChange `modified` property remains false when file component is updatedCó thể làm lại được @ZenMasterJacob20011 đã nhận 293 ngày trước và không có pull request nào đang mở. Đang mở
-
FormBuilder onChange callback not triggered when options prop is providedCó thể làm lại được @Victoriya25 đã nhận 335 ngày trước và không có pull request nào đang mở. Đang mở
-
FormBuilder with OnChange broke textareaCó thể làm lại được @lane-formio đã nhận 307 ngày trước và không có pull request nào đang mở. Đang mở
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
vercel-labs/ui#809 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bot:ai-assisted component:platform-js status:untriaged
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 74/100
midnightntwrk/platform-js#38 ·
-
[bug] Second false positive on high-cost plugin alert: detection only compares patch entry id, community plugin dsh-auto | [bug] 高成本插件告警第二次误报:检测只比对 patch 条目 id,社区插件 dsh-auto-review 被认成 @deepseek-ai/dsh-experimental-auto-reviewCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
ranxianglei/billion-context#7068 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
vendor: bump whisper.cpp past 6a8addd — the current pin aborts the app on a failed Metal initĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
mybigday/whisper.rn#348 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
six-group/six-webcomponents#600 ·