mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
This commit is contained in:
parent
147612a552
commit
4065549d1d
1 changed files with 0 additions and 23 deletions
|
@ -6,29 +6,6 @@ import { Markdown } from 'ui/markdown/markdown';
|
|||
*/
|
||||
class MarkdownVisComponent extends Component {
|
||||
|
||||
/**
|
||||
* This method will be called when props or the state has been updated, and
|
||||
* we should return whether we want the render method to be called again (true)
|
||||
* or if we know that the render method wouldn't produce anything different and
|
||||
* we don't need it to be called (false).
|
||||
*
|
||||
* We only need to render if one of the parameters used in the render function
|
||||
* actually changed. So we prevent calling render if none of it changed.
|
||||
*/
|
||||
shouldComponentUpdate(props) {
|
||||
const shouldUpdate = props.fontSize !== this.props.fontSize ||
|
||||
props.openLinksInNewTab !== this.props.openLinksInNewTab ||
|
||||
props.markdown !== this.props.markdown;
|
||||
|
||||
// If we won't update, we need to trigger the renderComplete method here,
|
||||
// since we will never render and thus never get to componentDidUpdate.
|
||||
if (!shouldUpdate) {
|
||||
this.props.renderComplete();
|
||||
}
|
||||
|
||||
return shouldUpdate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Will be called after the first render when the component is present in the DOM.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue