nickzuber / markup

:sparkles::turtle: Create & share TeX snippets with rich math typesetting and markdown support.
https://markup-app.com/
MIT License
7 stars 2 forks source link

Bug - Rendering issue when opening an empty document #5

Closed nickzuber closed 7 years ago

nickzuber commented 7 years ago

How to reproduce:

And the home page's text isn't compiled. Weird.

nickzuber commented 7 years ago

Fixed in https://github.com/markup-app/markup/commit/baf4b1e78fb6fcd711241a4b92c099569c8e33ef

We never initialized the text when the component mounts, but rather only when the props change.

Simply just add this check to componentDidMount

if (this.props) {
  let processedText = this.transpileRawTextData(this.props.text);
  document.querySelector(`[data-text-pid="${this._internalPID}"]`).innerHTML = processedText;
}