Skip to content

Commit ad44d48

Browse files
committed
Ref types need to be E|null instead of E|undefined.
1 parent 9b8c45a commit ad44d48

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

components/gather-tile-details-modal.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,9 @@ export function GatherTileDetailsModal({ tile, tileDetails, setTileDetails,
4747
setTileDetails({ ...tileDetails, detailString: event.target.value });
4848
}, [setTileDetails, tileDetails]);
4949

50-
const addYourOwnRef = useRef<HTMLInputElement>();
51-
const onShow = useCallback(()=>{
52-
if (addYourOwnRef.current) {
53-
addYourOwnRef.current.focus();
54-
}
50+
const addYourOwnRef = useRef<HTMLInputElement>(null);
51+
const onShow = useCallback(() => {
52+
addYourOwnRef.current?.focus();
5553
}, []);
5654

5755
return <Modal show={true} onShow={onShow} onHide={onCancel}>

0 commit comments

Comments
 (0)