@uiw/react-codemirror 4.21.24 → 4.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/useCodeMirror.d.ts +2 -2
- package/dist/codemirror.js +125 -44
- package/dist/codemirror.min.js +1 -1
- package/esm/useCodeMirror.d.ts +2 -2
- package/package.json +2 -2
- package/src/useCodeMirror.ts +2 -2
package/esm/useCodeMirror.d.ts
CHANGED
|
@@ -9,6 +9,6 @@ export declare function useCodeMirror(props: UseCodeMirror): {
|
|
|
9
9
|
setState: import("react").Dispatch<import("react").SetStateAction<EditorState | undefined>>;
|
|
10
10
|
view: EditorView | undefined;
|
|
11
11
|
setView: import("react").Dispatch<import("react").SetStateAction<EditorView | undefined>>;
|
|
12
|
-
container: HTMLDivElement | undefined;
|
|
13
|
-
setContainer: import("react").Dispatch<import("react").SetStateAction<HTMLDivElement | undefined>>;
|
|
12
|
+
container: HTMLDivElement | null | undefined;
|
|
13
|
+
setContainer: import("react").Dispatch<import("react").SetStateAction<HTMLDivElement | null | undefined>>;
|
|
14
14
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uiw/react-codemirror",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.22.0",
|
|
4
4
|
"description": "CodeMirror component for React.",
|
|
5
5
|
"homepage": "https://uiwjs.github.io/react-codemirror",
|
|
6
6
|
"funding": "https://jaywcjlove.github.io/#/sponsor",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@codemirror/commands": "^6.1.0",
|
|
40
40
|
"@codemirror/state": "^6.1.1",
|
|
41
41
|
"@codemirror/theme-one-dark": "^6.0.0",
|
|
42
|
-
"@uiw/codemirror-extensions-basic-setup": "4.
|
|
42
|
+
"@uiw/codemirror-extensions-basic-setup": "4.22.0",
|
|
43
43
|
"codemirror": "^6.0.0"
|
|
44
44
|
},
|
|
45
45
|
"keywords": [
|
package/src/useCodeMirror.ts
CHANGED
|
@@ -38,7 +38,7 @@ export function useCodeMirror(props: UseCodeMirror) {
|
|
|
38
38
|
root,
|
|
39
39
|
initialState,
|
|
40
40
|
} = props;
|
|
41
|
-
const [container, setContainer] = useState<HTMLDivElement>();
|
|
41
|
+
const [container, setContainer] = useState<HTMLDivElement | null>();
|
|
42
42
|
const [view, setView] = useState<EditorView>();
|
|
43
43
|
const [state, setState] = useState<EditorState>();
|
|
44
44
|
const defaultThemeOption = EditorView.theme({
|
|
@@ -114,7 +114,7 @@ export function useCodeMirror(props: UseCodeMirror) {
|
|
|
114
114
|
};
|
|
115
115
|
}, [container, state]);
|
|
116
116
|
|
|
117
|
-
useEffect(() => setContainer(props.container
|
|
117
|
+
useEffect(() => setContainer(props.container), [props.container]);
|
|
118
118
|
|
|
119
119
|
useEffect(
|
|
120
120
|
() => () => {
|