ShaMan123 / react-native-math-view

Math view for react native! No WebView!
https://github.com/ShaMan123/react-native-math-view
MIT License
77 stars 24 forks source link

How to suppress errors that cause app crash? #57

Closed hypnocill closed 2 years ago

hypnocill commented 2 years ago

If an unexpected input comes along, like '\sqrt{x-1}+\frac{1}{\sqrt{(x-2)}^2^}' - (at the end it has an exponent ^ without anything after it) - it causes the app to crash with 'Missing open brace for superscript. If you meant to render a collection of children, use an array instead'.

Is there a way to prevent those crashes and fallback to rendering the raw latex or at least to keep the app running and show an error message but not crash?

hypnocill commented 2 years ago

'renderError' prop seems to be working well. It was probably my mistake for not utilising it at first. Sorry to bother you again and thank you for the great effort you've put into this library!