Using LaTeX with react-plotly


I am having issues with using LaTeX with react-plotly. I need to be able to use the result HTML file offline, so importing mathjax from a CDN is not an option. What would be the suggested way of doing it, since I couldn’t find anything about it in react-plotly documentation?