fast-reflexes / better-react-mathjax

MIT License
124 stars 16 forks source link

Re-rendering issues in prod version in `nextjs` website #41

Closed vinsis closed 1 year ago

vinsis commented 1 year ago

First of all thank you for such a useful library. I used it in a NextJS based website. While in dev mode, everything worked well. But I realized there are some re-rendering issues in the build mode. As an example, whenever I press any of the arrow buttons in this link, the latex breaks immediately (instead of re-rendering with updated data). A screenshot is shown below:

Screenshot 2023-03-28 at 9 11 14 PM

I would like to ask if this is a known issue. And if so, do I need to make any changes to make it work? Thank you

Edit: I think it is probably an issue with this library and not NextJS is because other components render just fine. Even the latex string gets updated the way it should. But the latex string -> symbol conversion doesn't happen.

elias-at-levels commented 1 year ago

Hi! Thanks for writing!

Did you add the dynamic property to the MathJax element?

vinsis commented 1 year ago

Yup that worked! Thank you again!