diff --git a/src/index.js b/src/index.js index 7c204c0..042836f 100644 --- a/src/index.js +++ b/src/index.js @@ -1,7 +1,7 @@ import hljs from 'highlight.js'; import React from 'react'; -class Highlight extends React.Component { +class Highlight extends React.PureComponent { constructor(props) { super(props) this.setEl = this.setEl.bind(this) diff --git a/src/optimized.js b/src/optimized.js index e97f670..c45a321 100644 --- a/src/optimized.js +++ b/src/optimized.js @@ -1,7 +1,7 @@ import hljs from'highlight.js/lib/highlight'; import React from'react'; -class Highlight extends React.Component { +class Highlight extends React.PureComponent { componentDidMount() { this.highlightCode(); }