[BUG] Custom component unmounting
@Sidiro23 がすでに取り組んでいます。
2024年7月31日 から。
評価
この issue はまだ評価されていません。
説明
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
- 主要言語
- TypeScript
- スター
- 371
- フォーク
- 309
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
formio/react のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 64/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
-
onChange `modified` property remains false when file component is updated再び着手できるかも @ZenMasterJacob20011 が 293 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
-
FormBuilder onChange callback not triggered when options prop is provided再び着手できるかも @Victoriya25 が 335 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
-
FormBuilder with OnChange broke textarea再び着手できるかも @lane-formio が 307 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
vercel-labs/ui#809 ·
メンテナーはふだん 1 日以内に返信
-
bot:ai-assisted component:platform-js status:untriaged
難易度 1/5 1時間未満 初心者へのやさしさ 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-review対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ranxianglei/billion-context#7068 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
mybigday/whisper.rn#348 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
six-group/six-webcomponents#600 ·