react-codemirror icon indicating copy to clipboard operation
react-codemirror copied to clipboard

JSON sometimes doesn't have folding arrows.

Open wymli opened this issue 8 months ago • 1 comments

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!

wymli avatar Jun 24 '24 08:06 wymli