Skip to content

Commit 22b7298

Browse files
committed
add comments
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
1 parent 9d1a3c9 commit 22b7298

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎src/components/views/elements/SyntaxHighlight.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,14 @@ export default class SyntaxHighlight extends React.Component {
3030
this._ref = this._ref.bind(this);
3131
}
3232

33+
// componentDidUpdate used here for reusability
34+
// componentWillReceiveProps fires too early to call highlightBlock on.
3335
componentDidUpdate() {
3436
if (this._el) highlightBlock(this._el);
3537
}
3638

39+
// call componentDidUpdate because _ref is fired on initial render
40+
// which does not fire componentDidUpdate
3741
_ref(el) {
3842
this._el = el;
3943
this.componentDidUpdate();

0 commit comments

Comments
 (0)