Commit 2e8dd196 by ryan

use pure component

parent 627a32e9
import React, { Component } from 'react';
import React, { PureComponent } from 'react';
import Remarkable from 'remarkable';
import { sanitize } from 'app/core/utils/text';
......@@ -14,7 +14,7 @@ interface State {
html: string;
}
export class TextPanel extends Component<Props, State> {
export class TextPanel extends PureComponent<Props, State> {
remarkable: Remarkable;
constructor(props) {
......@@ -30,11 +30,11 @@ export class TextPanel extends Component<Props, State> {
if (html !== this.state.html) {
this.setState({ html });
}
}, 100);
}, 150);
componentDidUpdate(prevProps: Props) {
// Since any change could be referenced in a template variable,
// This needs to process everything
// This needs to process everytime (with debounce)
this.updateHTML();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment