set maxLines
as 1 or 2, with onLoad
set wrap mode as true at the same time, click before the last curly brace and type Enter button to make the editor formatting automatically, you will find the browser stuck and the memory raising.
<AceEditor
mode="json" maxLines={2} value={"{\"a\":\"b\"}"}
onLoad={editor => editor.getSession().setUseWrapMode(true)}
/>
or visit the simple project react-ace-editor-issuse
Initial memory and CPU
10 sec after type Enter button
Progress on: #
Win 10 / Chrome 58&IE 11/ React 15.6.1
We considered moving away from https://github.com/JedWatson/react-codemirror because at least at the moment it is not maintained well (aka the maintainer does not merge or reacts to PRs) but this here is a blocker that stops that.
@SecMao I'm unable to reproduce on my mac. I'll need to find a Windows laptop to reproduce.
@inoas were you able to reproduce this issue? I see a few comments mentioning that you were looking to switch from codemirror but it's unclear if you saw these issues locally.
We haven't made the move just yet and will try to reproduce this if we do and report back in either case (no leak or "looks like" leak)
i am using React v16.4, react-ace v6.1.2
create-react-app
maxLines
and wrapEnabled
class App extends React.Component {
render() {
const props = {
mode: 'javascript',
theme: 'monokai',
value: 'const test = \'hello loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong text\'',
maxLines: 1,
wrapEnabled: true,
};
return (
<div>
<AceEditor {...props} />
</div>
);
}
}
and it will cause cpu and memory raising
Most helpful comment
i am using React v16.4, react-ace v6.1.2
create-react-app
maxLines
andwrapEnabled
and it will cause cpu and memory raising