Reputation: 2359
I am using react-native-mathjax
for rendering mathematical equations in my react native app but auto-adjust height of webview is not working in react-native-mathjax
library when I move to the next query. react-native-mathjax
takes the previous height to render the next query. how can I adjust view height in my app?
import React from 'react';
import { View, Text } from 'react-native';
import MathJax from 'react-native-mathjax';
function Test() {
return (
<View>
<MathJax
html={<p><span class="math-tex">\(\begin{bmatrix} 2 &1 \\[0.3em] 3&4\\[0.3em] \end{bmatrix}\)</span></p>}
/>
</View>
);
}
export default Test;
Upvotes: 1
Views: 391
Reputation: 369
Use react-native-autoheight-webview
inside react-native-mathjax
instead of react-native-webview
. It will automatically adjust height of webview when you move to next query.
npm install react-native-autoheight-webview
Upvotes: 1