0

I am trying to render some formulas stored in the DB in mathml, in the react app i am using the plugin as suggested here: wiris. by adding to the head the tag: <script src="https://www.wiris.net/demo/plugins/app/WIRISplugins.js?viewer=image"></script> however, the svg images are not generated and just the mathml is showing.

After this, I tried adding it using a useEffect:

    useEffect(() => {
      const script = document.createElement('script');
      script.src = 'https://www.wiris.net/demo/plugins/app/WIRISplugins.js?viewer=image';
      document.head.appendChild(script);
    }, []);

And also did not work at first, but when i change the document.head.appendChild(script); line to document.body.appendChild(script); the HMR fires and that moment the WIRISplugins.js works and convert the mathml into images. but if i do a manual reload it again stop working.

Csharls
  • 550
  • 8
  • 19

0 Answers0