@uiw/react-codemirror 4.21.14 → 4.21.16
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/README.md +5 -10
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -103,17 +103,12 @@ import CodeMirror from '@uiw/react-codemirror';
|
|
|
103
103
|
import { javascript } from '@codemirror/lang-javascript';
|
|
104
104
|
|
|
105
105
|
function App() {
|
|
106
|
-
const
|
|
107
|
-
|
|
106
|
+
const [value, setValue] = React.useState("console.log('hello world!');");
|
|
107
|
+
const onChange = React.useCallback((val, viewUpdate) => {
|
|
108
|
+
console.log('val:', val);
|
|
109
|
+
setValue(val);
|
|
108
110
|
}, []);
|
|
109
|
-
return (
|
|
110
|
-
<CodeMirror
|
|
111
|
-
value="console.log('hello world!');"
|
|
112
|
-
height="200px"
|
|
113
|
-
extensions={[javascript({ jsx: true })]}
|
|
114
|
-
onChange={onChange}
|
|
115
|
-
/>
|
|
116
|
-
);
|
|
111
|
+
return <CodeMirror value={value} height="200px" extensions={[javascript({ jsx: true })]} onChange={onChange} />;
|
|
117
112
|
}
|
|
118
113
|
export default App;
|
|
119
114
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uiw/react-codemirror",
|
|
3
|
-
"version": "4.21.
|
|
3
|
+
"version": "4.21.16",
|
|
4
4
|
"description": "CodeMirror component for React.",
|
|
5
5
|
"homepage": "https://uiwjs.github.io/react-codemirror",
|
|
6
6
|
"author": "kenny wong <wowohoo@qq.com>",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@codemirror/commands": "^6.1.0",
|
|
41
41
|
"@codemirror/state": "^6.1.1",
|
|
42
42
|
"@codemirror/theme-one-dark": "^6.0.0",
|
|
43
|
-
"@uiw/codemirror-extensions-basic-setup": "4.21.
|
|
43
|
+
"@uiw/codemirror-extensions-basic-setup": "4.21.16",
|
|
44
44
|
"codemirror": "^6.0.0"
|
|
45
45
|
},
|
|
46
46
|
"keywords": [
|