File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ import CodeMirror from '@uiw/react-codemirror' ;
2
+ import { EditorView } from '@uiw/react-codemirror' ;
3
+ import { Fragment , useCallback , useState } from 'react' ;
4
+
5
+ const code = `## Title
6
+
7
+ [weisit ulr](https://uiwjs.github.io/react-codemirror/)
8
+ four
9
+ **Bold text**
10
+ ` ;
11
+
12
+ /**
13
+ * https://github.com/uiwjs/react-codemirror/issues/674
14
+ */
15
+ export function Component ( ) {
16
+ const [ value , setValue ] = useState ( code ) ;
17
+
18
+ const onChange = useCallback ( ( val : string ) => {
19
+ setValue ( val ) ;
20
+ } , [ ] ) ;
21
+
22
+ return (
23
+ < Fragment >
24
+ < CodeMirror
25
+ value = { value }
26
+ theme = "none"
27
+ height = "400px !important"
28
+ width = "100%"
29
+ onChange = { onChange }
30
+ style = { { margin : '0 0 23px 0' , flex : 1 } }
31
+ extensions = { [ EditorView . contentAttributes . of ( { spellcheck : 'true' } ) ] }
32
+ />
33
+ </ Fragment >
34
+ ) ;
35
+ }
Original file line number Diff line number Diff line change @@ -658,6 +658,11 @@ export const routes: MenuRouteObject[] = [
658
658
label : 'How to remove all syntax highlighting?' ,
659
659
lazy : ( ) => import ( './pages/examples/Example431' ) ,
660
660
} ,
661
+ {
662
+ path : '674' ,
663
+ label : 'Browser spell checking' ,
664
+ lazy : ( ) => import ( './pages/examples/Example674' ) ,
665
+ } ,
661
666
{
662
667
path : '455' ,
663
668
label : 'CodeMirrorMerge use theme' ,
You can’t perform that action at this time.
0 commit comments