0.0.3 • Published 2 years ago
react-codemirror-ts v0.0.3
react-codemirror-ts
Codemirror react wrapper made with typescript
Installation
npm i react-codemirror-ts
Usage
import { Codemirror } from 'react-codemirror-ts';
import React, { useState } from 'react';
import 'codemirror/mode/javascript/javascript';
import 'codemirror/addon/edit/matchbrackets';
import 'codemirror/lib/codemirror.css';
function CodemirrorExample() {
const [value, setValue] = useState<string>('');
return (
<Codemirror
defaultValue=""
value=""
name="example"
path="example"
options={{
lineNumbers: true,
lineWrapping: true,
matchBrackets: true,
mode: 'javascript',
tabSize: 2,
}}
onChange={(value, options) => {
setValue(value);
}}
/>
);
}
export { CodemirrorExample };
License
Refer to LICENSE file
0.0.3
2 years ago
0.0.2
3 years ago
0.0.1
3 years ago
0.0.1-alpha.3
3 years ago
0.0.1-alpha.2
3 years ago
0.0.1-alpha.1
3 years ago