Skip to content

Commit

Permalink
Ref types need to be E|null instead of E|undefined.
Browse files Browse the repository at this point in the history
  • Loading branch information
jyasskin committed Jul 24, 2020
1 parent 9b8c45a commit ad44d48
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions components/gather-tile-details-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,9 @@ export function GatherTileDetailsModal({ tile, tileDetails, setTileDetails,
setTileDetails({ ...tileDetails, detailString: event.target.value });
}, [setTileDetails, tileDetails]);

const addYourOwnRef = useRef<HTMLInputElement>();
const onShow = useCallback(()=>{
if (addYourOwnRef.current) {
addYourOwnRef.current.focus();
}
const addYourOwnRef = useRef<HTMLInputElement>(null);
const onShow = useCallback(() => {
addYourOwnRef.current?.focus();
}, []);

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

0 comments on commit ad44d48

Please sign in to comment.