Closed mraghuram closed 3 years ago
@mraghuram Wait for the official version to released.
Thanks. Looks like final beta is out.
Any update on this?
@addingama Still waiting...
Upgrade @uiw/react-codemirror@4.0.0-rc.4
+++
import CodeMirror from '@uiw/react-codemirror';
- import 'codemirror/mode/javascript/javascript';
+ import { javascript } from "@codemirror/lang-javascript";
const code = 'console.log("hello world!");';
<CodeMirror
value={code}
- options={{
- mode: 'js',
- }}
+ extensions={[
+ javascript({ jsx: true })
+ ]}
/>
I have not found any language packs that support yaml. Can you help me?
@jaywcjlove
@jaywcjlove 我看这个链接,没有发现可以支持yaml的语言包,这是怎么回事呢?我需要你的帮助
@gitluck1314 https://gitee.com/uiw/react-codemirror
import CodeMirror from '@uiw/react-codemirror';
import { StreamLanguage } from '@codemirror/language';
import { yaml } from '@codemirror/legacy-modes/mode/yaml';
const yamlLang = `yaml......`;
export default function App() {
return (
<CodeMirror
value={yamlLang}
height="200px"
extensions={[StreamLanguage.define(yaml)]}
/>
);
}
I am getting this error after adding any language extension:: Cannot read properties of null (reading 'extension')
Hi, just curious to know if there is a plan to upgrade this to CodeMirror 6.
Thanks for all the amazing stuff so far.