Closed guanghechen closed 2 years ago
Close this pr as it fix nothing.
Thanks for contributing! I'm sorry the fix didn't work ... is there an alternate fix? Could you supply a code sandbox showing the problem and I can see how it can be fixed? Thanks for trying :)
Hi @fast-reflexes , thanks for the reply!
I have tried many ways to fix this problem but got nothing. The issue is that when switching routes, components will be unmounted and then re-mounted, but equation numbers are not cleared. I created a demo to show the problem, see https://codesandbox.io/s/vigorous-bird-h7fsuw?file=/src/App.js, hope it helps :)
re-render
button
Hi @fast-reflexes , thank you for creating such a awesome project, I'm really appreciate it! But I encountered a typesetting bug when using this package, so I create this pr and hope this pr can fix it.
Scenario
In a single-page application, when we switch routes and trigger the MathJax to re-render the page, if a formula in the page uses the
\label
instruction, it will cause theLabel multiple 'xxx' defined
error.Changes
fix: reset equation numbers before reprocess to avoid
Label multiple defined
error.Before
After