[BUG] Custom component unmounting
@Sidiro23 já está trabalhando nisso.
Desde 31/7/2024.
Avaliação
Esta issue ainda não foi avaliada.
Descrição
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
- Linguagem predominante
- TypeScript
- Estrelas
- 371
- Forks
- 309
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de formio/react
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 64/100
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
-
onChange `modified` property remains false when file component is updatedTalvez livre de novo @ZenMasterJacob20011 assumiu há 293 dias e não há nenhum pull request aberto. Aberta
-
FormBuilder onChange callback not triggered when options prop is providedTalvez livre de novo @Victoriya25 assumiu há 335 dias e não há nenhum pull request aberto. Aberta
-
FormBuilder with OnChange broke textareaTalvez livre de novo @lane-formio assumiu há 307 dias e não há nenhum pull request aberto. Aberta
Todas as issues de formio/react
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
vercel-labs/ui#809 ·
Mantenedores costumam responder em até 1 dia
-
bot:ai-assisted component:platform-js status:untriaged
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 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-reviewTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
ranxianglei/billion-context#7068 ·
Mantenedores costumam responder em até 1 dia
-
vendor: bump whisper.cpp past 6a8addd — the current pin aborts the app on a failed Metal initAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
mybigday/whisper.rn#348 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
six-group/six-webcomponents#600 ·