-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render incorrectly #48
Comments
I think having nested html causes change detection to not work correctly. My temporary solution is to use |
This problem has been documented before and it's due to how React works, even though the resulting problems happen to show here. Read how to add math content here: https://github.com/fast-reflexes/better-react-mathjax#general-considerations-dont-skip The React problem is described here: facebook/react#20891 but it has not received any attention. You're mixing string literals with the math content and this causes the problems you're seeing. Wrap the math content in its own element and it will work as expected, e.g. change |
@fast-reflexes Great! Thank you very much |
You're welcome... ! Just to clarify, it's not the mix of math and literal strings that is the problem, it's the mix of elements and math where the math content is not inside an element.. it's a bit hard to explain but for example, this works too: I will try to make these rules even clearer in the docs, but just be aware of this and that these situations are easily solved by using one of the structures described in the docs (or just wrapping the math in its own element) :) |
link codesanbox
When I use Better-React-Mathjax both parser text to react dom. I get incorrect text rendering.
In the above example, when I click on the
Delete text 123123123123
button I get the old text and the new text appear on 1 line.What is the solution? Thank you very much!
The text was updated successfully, but these errors were encountered: