Kaynağa Gözat

WIP: render page with react component

fix mathjax rendering trigger
Yuki Takei 8 yıl önce
ebeveyn
işleme
accc674097
1 değiştirilmiş dosya ile 6 ekleme ve 0 silme
  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() {
     MathJax.Hub.Queue(["Typeset", MathJax.Hub, this.element]);
   }