Просмотр исходного кода

WIP: render page with react component

fix mathjax rendering trigger
Yuki Takei 8 лет назад
Родитель
Сommit
accc674097
1 измененных файлов с 6 добавлено и 0 удалено
  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]);
   }