nodeRef solution for React 19 does not work due to incorrect build output
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 38/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- javascript, react
- Área
- build-system, frontend
Línea de trabajo
Start with lib/DraggableCore.js at the nodeRef check and compare its behavior with the compiled output shown in the issue. Run or review the linked main.spec.ts tests to reproduce the empty-ref case. Done means the built package preserves the intended nodeRef behavior and the React 19 scenario no longer falls back to findDOMNode.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
The recommended solution for the React 19 findDOMNode removal is to provide a DOM element reference via nodeRef. This does not work due to how react-draggable is being built.
The check being done for provided nodeRef here falls back to using ReactDOM.findDOMNode when nodeRef is an empty ref ({ current: null }), which is always the initial value for DOM refs.
The source code appears to be doing the correct thing and should not result in this behavior, but the compiled code changes the behavior:
findDOMNode() {
var _this$props$nodeRef$c, _this$props;
return (_this$props$nodeRef$c = (_this$props = this.props) === null || _this$props === void 0 || (_this$props = _this$props.nodeRef) === null || _this$props === void 0 ? void 0 : _this$props.current) !== null && _this$props$nodeRef$c !== void 0 ? _this$props$nodeRef$c : _reactDom.default.findDOMNode(this);
}
I have some tests proving this here.
- Lenguaje dominante
- JavaScript
- Estrellas
- 9.3k
- Forks
- 1k
- Merge medio
- 3 d 8 h
- PR fusionados (30 d)
- 4
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
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 react-grid-layout/react-draggable
-
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
react-grid-layout/react-draggable#784 · 4 comentarios · 2 reacciones ·
-
V4.5.0 Chrome Extension Error Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
react-grid-layout/react-draggable#782 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
react-grid-layout/react-draggable#781 · 1 comentario · 2 reacciones ·
-
the new version 4.5.0 会导致系统打包报错 Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
react-grid-layout/react-draggable#780 · 8 comentarios ·
Todos los issues de react-grid-layout/react-draggable
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
Daemon passes --experimental-wasm-jspi unconditionally on Node >= 24; Node 26 rejects the flag Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Automattic/studio#4908 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
sugarlabs/musicblocks#8847 ·