[BUG] Custom component unmounting
@Sidiro23 ya está trabajando en esto.
Desde el 31/7/2024.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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
- Lenguaje dominante
- TypeScript
- Estrellas
- 371
- Forks
- 309
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de formio/react
-
Dificultad 3/5 1-2 días Aptitud para principiantes 64/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
-
onChange `modified` property remains false when file component is updatedQuizá libre de nuevo @ZenMasterJacob20011 la tomó hace 293 días y no hay ningún pull request abierto. Abierto
-
FormBuilder onChange callback not triggered when options prop is providedQuizá libre de nuevo @Victoriya25 la tomó hace 335 días y no hay ningún pull request abierto. Abierto
-
FormBuilder with OnChange broke textareaQuizá libre de nuevo @lane-formio la tomó hace 307 días y no hay ningún pull request abierto. Abierto
Todos los issues de formio/react
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
vercel-labs/ui#809 ·
Los mantenedores suelen responder en 1 día
-
bot:ai-assisted component:platform-js status:untriaged
Dificultad 1/5 Menos de una hora Aptitud para principiantes 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-reviewPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
ranxianglei/billion-context#7068 ·
Los mantenedores suelen responder en 1 día
-
vendor: bump whisper.cpp past 6a8addd — the current pin aborts the app on a failed Metal initAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
mybigday/whisper.rn#348 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
six-group/six-webcomponents#600 ·