r/learnreactjs • u/rudyransone • Mar 13 '23
Question Help create Extension for CodeMirror 🥺🥺🥺
For me, the official documentation CodeMirror is very hard to read.
Task: Show a button when hovering over a field with text.
1
Upvotes
View all comments
Show parent comment
1
u/dbnoisemaker Mar 15 '23
well, what is your goal with the code editor?
what are you trying to achieve with it?
Is it just a notepad?
Notion is fairly complex, is there a specific feature you're trying to rebuild?
for your example
Task: Show a button when hovering over a field with text.
in react, have a state variable 'showButton', in the onMouseEnter and onMouseLeave properties of the button, set 'showButton to true and false respectively.
conditionally show the button based on the status of 'showButton'
If none of that makes sense, you may want to take some html/css/React basics.
It's really fun once you get the hang of i.