scniro / react-codemirror2

Codemirror integrated components for React
MIT License
1.66k stars 193 forks source link

Slows down when there's lots of code #47

Closed PaperjetStudios closed 6 years ago

PaperjetStudios commented 6 years ago

Hey there,

When I have a lot of text on the editor, it starts slowing down quite considerably. I suspect it's because of updating state all the time whenever a keystroke is made, and when there is a lot of code, there is a lot to update.

I'm basically using the example code onChangeBefore on the Controlled version. Around 400 lines and it becomes unusable. Should I have like a timeout or something?

Sorry if this is dumb. :)

PaperjetStudios commented 6 years ago

IGNORE ME

This fixes it: https://github.com/scniro/react-codemirror2/issues/41