SamyPesse / react-mathjax

React component to display math formulas
Apache License 2.0
95 stars 35 forks source link

Duplicate MathJax nodes rendered #21

Open nikolas opened 6 years ago

nikolas commented 6 years ago

Hi, I have a react program set up with a MathJax node hooked up to some sliders, like this:

2018-07-16-132129_906x326_scrot

When I move these sliders, multiple MathJax nodes appear:

2018-07-16-131959_995x381_scrot

I will also note that using this react-mathjax library solves this problem: https://github.com/wko27/react-mathjax (registered as react-mathjax2 in npm).

techrah commented 6 years ago

I'm having the same issue too. If this component is rendering based on component state, after a few state updates it starts to show the resulting formula twice.

Deniscapp commented 5 years ago

Same problem here

FBosler commented 4 years ago

I've got the same problem. Where you guys able to fix it?

connorff commented 2 years ago

I was having the same issue: image

It seems the MathJax.Node renders the formula in two spans (one with the class MathJax_Preview and the other with the classes mjx-chtml MathJax_CHTML): image

Hiding the MathJax_Preview span with the following CSS solved my issue:

span.MathJax_Preview {
  display: none;
}