Skip to content

Commit

Permalink
type: correct container type (#639)
Browse files Browse the repository at this point in the history
  • Loading branch information
yifanwww authored Mar 7, 2024
1 parent 40dcf1c commit 560ebb8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/useCodeMirror.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function useCodeMirror(props: UseCodeMirror) {
root,
initialState,
} = props;
const [container, setContainer] = useState<HTMLDivElement>();
const [container, setContainer] = useState<HTMLDivElement | null>();
const [view, setView] = useState<EditorView>();
const [state, setState] = useState<EditorState>();
const defaultThemeOption = EditorView.theme({
Expand Down Expand Up @@ -114,7 +114,7 @@ export function useCodeMirror(props: UseCodeMirror) {
};
}, [container, state]);

useEffect(() => setContainer(props.container!), [props.container]);
useEffect(() => setContainer(props.container), [props.container]);

useEffect(
() => () => {
Expand Down

0 comments on commit 560ebb8

Please sign in to comment.