fix(ci): stop writing dialog close refs during render
eslint-plugin-react-hooks forbids updating ref.current in render, which failed staging lint after the compact rectification board landed. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -208,8 +208,6 @@ export function RectificationBoard({
|
||||
onClose: () => void;
|
||||
}>) {
|
||||
const dialogRef = useRef<HTMLDialogElement>(null);
|
||||
const onCloseRef = useRef(onClose);
|
||||
onCloseRef.current = onClose;
|
||||
const body = (
|
||||
<RectificationBoardBody
|
||||
result={result}
|
||||
@@ -235,10 +233,10 @@ export function RectificationBoard({
|
||||
if (!compact) return;
|
||||
const node = dialogRef.current;
|
||||
if (!node) return;
|
||||
const handleClose = () => onCloseRef.current();
|
||||
const handleClose = () => onClose();
|
||||
node.addEventListener("close", handleClose);
|
||||
return () => node.removeEventListener("close", handleClose);
|
||||
}, [compact]);
|
||||
}, [compact, onClose]);
|
||||
|
||||
if (compact) {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user