Open pugtooth opened 1 year ago
That's very likely caused by the useLayoutEffect's dependency towards darkMode
changes.
Whenever the value change, the useLayoutEffect callback is triggered, so it will call the crepe.destroy()
first, and then re-creating a new editor with the original default content.
Initial checklist
Affected packages and versions
Milkdown Playgroundv7.3.0
Link to runnable example
No response
Steps to reproduce
Type anything into the editor, switch between light modes, and the source text will be reset to default text.
Expected behavior
You keep your text (sorry for lame response, but I feel like this is a given)
Actual behavior
The preview will not be effected, but the source text will be reset to the default text.
Runtime
Chrome
OS
Linux
Build and bundle tools
No response