calvinkei / react-native-mathjax

Render Mathjax content in React Native Webview
MIT License
34 stars 37 forks source link

Replace react-native-autoheight-webview with WebView #13

Closed mrded closed 6 years ago

mrded commented 6 years ago

I found a way to adjust the height without using react-native-autoheight-webview module.

Can you please review? It also solves problems with android: https://github.com/calvinkei/react-native-mathjax/issues/9

calvinkei commented 6 years ago

it doesn't work for me.

  1. this.state.height should be initialized in the constructor to prevent undefined height error
  2. if i run it with the demo project, WebView cannot be shown as width is 0
  3. even if i set width to screen width, height of the webview is still not auto adjusted

can you provide a working example code?

mrded commented 6 years ago

The problem is also related to this issue: https://github.com/facebook/react-native/issues/11594

Let me try to fix it, I'll get back to you.

mrded commented 6 years ago

@calvinkei Please have a look new version.

this.state.height is set to 1 by default. Which also solved the problem with Hiding content until typesetting is completehttps://github.com/calvinkei/react-native-mathjax/pull/12