fast-reflexes / better-react-mathjax

MIT License
132 stars 16 forks source link

better-react-mathjax for react nactive? #47

Closed o-b2-to closed 1 year ago

o-b2-to commented 1 year ago

can i use better-react-mathjax for react nactive app?

fast-reflexes commented 1 year ago

Hi!

You can always try but I would assume not. As it says here, libraries which are more or less vanilla Javascript only will likely work with React Native but if the libraries depend too much on a particular context, they won't. Both MathJax and therefore better-react-mathjax heavily depends on the browser as an environment so therefore I believe it won't work with React Native.

Maybe in the future if there is a way to do SSR rendering, this might work better with React Native but for now, I think not unfortunately.

o-b2-to commented 1 year ago

thanks !

pkra commented 1 year ago

MathJax [..] heavily depends on the browser

That's not quite accurate (starting with MathJax v3). There are a couple of react-native integrations out there (just search npm), some use webviews but some just use the SVG output directly, e.g., https://github.com/oguzhankurumm/react-native-mathjax-text-svg. (Disclaimer: I've never personally used these, this is just an FYI that it's possible.)

fast-reflexes commented 1 year ago

@pkra Thanks Peter for your input! Good to know! At least it's not the out of the box way to use Mathjax so it would require some extra work / additions to this package for it to work :)