uiwjs / react-codemirror

CodeMirror 6 component for React. @codemirror https://uiwjs.github.io/react-codemirror/
https://uiwjs.github.io/react-codemirror/
MIT License
1.63k stars 129 forks source link

JSON sometimes doesn't have folding arrows. #664

Open wymli opened 3 months ago

wymli commented 3 months ago

What I see

I found that in my local development environment, there is no collapse arrow in front of some variables. image

What I expect

I found that in online demo env(https://uiwjs.github.io/react-codemirror/#/extensions/languages), it works well. image

How I use it

import CodeMirror from '@uiw/react-codemirror'; // https://github.com/uiwjs/react-codemirror
import { githubLight } from '@uiw/codemirror-theme-github'; // https://uiwjs.github.io/react-codemirror/#/theme/data/github/light
import {
  loadLanguage,
  langNames,
  langs,
} from '@uiw/codemirror-extensions-langs';

<CodeMirror
  value={data}
  readOnly={true}
  height="80vh"
  width="90vw"
  extensions={[githubLight, loadLanguage('json')]}
/>
"@uiw/codemirror-extensions-langs": "^4.22.2",
"@uiw/codemirror-theme-github": "^4.22.2",
"@uiw/react-codemirror": "^4.22.2",

Reproduce

codesandbox Thanks in advance!

jaywcjlove commented 3 months ago

@wymli I did encounter this issue during testing, but I haven't identified the cause yet.