-
Notifications
You must be signed in to change notification settings - Fork 260
Open
Description
Changing props.value does not re-render code mirror. This is a new issue in v1.0.0, previously this worked. Changing props.value via the onChange event works fine, but programmatically changing props.value does not call a re-render.
This can be reproduced with the following code.
class Editor extends Component {
constructor() {
super();
this.state = { value: 'abc' };
}
render() {
const { value } = this.state;
console.log(value);
return (
<div>
<CodeMirror value={value} />
<button onClick={() => this.setState({ value: 'def' })}>Click to change value</button>
</div>
);
}
}
This appears like it may have something to do with this change listed in the history file: fixed; Only updates the CodeMirror value if props.value has changed.
mythz, sgervais-uptycs, moroshko, Janpot, stonelee and 54 more
Metadata
Metadata
Assignees
Labels
No labels