-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
36 lines (31 loc) · 920 Bytes
/
App.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import * as React from 'react';
// formating styles (makes sure text stays inside editor box)
import 'codemirror/lib/codemirror.css';
// aesthetic styles
import 'codemirror/theme/material.css'; // syntax highlighting
import 'codemirror/mode/xml/xml'; // theme styles
import { Controlled as ControlledEditor } from 'react-codemirror2';
import './style.css';
export default function App() {
const [value, setValue] = React.useState('bruh');
return (
<div>
<h1>Hello StackBlitz!</h1>
<p>Start editing to see some magic happen :)</p>
<ControlledEditor
onBeforeChange={(editor, data, value) => {
setValue(value);
}}
value={value}
className="code-mirror-wrapper"
options={{
lineWrapping: true,
lint: true,
mode: 'xml',
theme: 'material',
lineNumbers: true,
}}
/>
</div>
);
}