fast-reflexes / better-react-mathjax

MIT License
124 stars 16 forks source link

Not rendering latex consistently #18

Closed ben-brooker closed 2 years ago

ben-brooker commented 2 years ago
Screenshot 2022-06-28 at 12 38 55

I am building a NextJS application with server-side rendering. This code works fine in some cases and not in others. For example, Upon refreshing a successfully rendered page, the wrapper seems to no longer work. Also, it seems to work well on edge but not safari. Are you aware of this issue? Is there a way around it? Thanks.

fast-reflexes commented 2 years ago

Can you recreate the behaviour in a sandbox perhaps?

Last time I tested it it worked as it should in all browsers and I have a NextJS application with SSR myself where I have never experienced any problems so there is likely something additional at play here.

Also, why do you use dangerouslySetInnerHTML? Is this a component or the root of your app? The MathJaxContext should only be in the root component of the app.. not that this should affect the current behaviour but still :)

ben-brooker commented 2 years ago

Hi,

The MathJaxContext component wraps a HTML component which formats text. The project is rather large which is why I opted to only wrap this component.

It is now working on the browsers, however it flickers slightly (between rendered and non-rendered) when refreshing the page (and sometime does not render the latex). Do you know why this happens?

fast-reflexes commented 2 years ago

It sounds like you have a complex setup with potentially some very particular scenarios...

Can you point me to anywhere where this can be seen? Almost impossible to help out otherwise :(

fast-reflexes commented 2 years ago

Removing since no further information was added. Please reopen with more information if needed.