-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Closed
Labels
bugAn error in the Docusaurus core causing instability or issues with its executionAn error in the Docusaurus core causing instability or issues with its execution
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Prerequisites
- I'm using the latest version of Docusaurus.
- I have tried the
npm run clearoryarn clearcommand. - I have tried
rm -rf node_modules yarn.lock package-lock.jsonand re-installing packages. - I have tried creating a repro with https://new.docusaurus.io.
- I have read the console error message carefully (if applicable).
Description
If react-live LivePreview is re-rendered, it will peform preview from the LiveProvider code prop instead of the current state of the content.
I fixed this in something similar using theLiveEditor onChange prop, to keep state of the current code being edited, and passing that state to the LiveProvider instead of the original code.
Reproducible demo
No response
Steps to reproduce
- Go to https://docusaurus.io/docs/markdown-features/code-blocks#interactive-code-editor
- Add some text after the period in the output
- Change the theme
Expected behavior
The newly edited code is used for the preview
Actual behavior
The original code is used for the preview until a subsequent edit
Your environment
No response
Self-service
- I'd be willing to fix this bug myself.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugAn error in the Docusaurus core causing instability or issues with its executionAn error in the Docusaurus core causing instability or issues with its execution