Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to dynamically set height? #362

Closed
YuAoi opened this issue Jul 29, 2022 · 2 comments
Closed

How to dynamically set height? #362

YuAoi opened this issue Jul 29, 2022 · 2 comments

Comments

@YuAoi
Copy link

YuAoi commented Jul 29, 2022

How to dynamically set height?

@jaywcjlove
Copy link
Member

jaywcjlove commented Jul 29, 2022

@YuAoi Not sure if it's what you want: https://codesandbox.io/embed/react-codemirror-example-codemirror-6-forked-gkwcbj?fontsize=14&hidenavigation=1&theme=dark

<CodeMirror
  value="console.log('hello world!');"
+  height="100%"
  style={{
+    height: '100%'
  }}
/>

@YuAoi
Copy link
Author

YuAoi commented Jul 30, 2022

@jaywcjlove 老哥,简直太棒了。这个用法有点奇怪,但是很有效。

@YuAoi YuAoi closed this as completed Jul 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants