Browse Source

WIP: render page with react component

fix mathjax rendering trigger
Yuki Takei 8 years ago
parent
commit
accc674097
1 changed files with 6 additions and 0 deletions
  1. 6 0
      resource/js/components/Page/RevisionBody.js

+ 6 - 0
resource/js/components/Page/RevisionBody.js

@@ -24,6 +24,12 @@ export default class RevisionBody extends React.Component {
     }
     }
   }
   }
 
 
+  componentWillReceiveProps(nextProps) {
+    if (MathJax != null && this.props.isMathJaxEnabled && this.props.renderMathJaxOnInit) {
+      this.renderMathJax();
+    }
+  }
+
   renderMathJax() {
   renderMathJax() {
     MathJax.Hub.Queue(["Typeset", MathJax.Hub, this.element]);
     MathJax.Hub.Queue(["Typeset", MathJax.Hub, this.element]);
   }
   }