SpencerDuball / spencerduball.com

My personal website: blog, projects, social links, etc.
https://spencerduball.com
MIT License
1 stars 0 forks source link

Flash during MDX editor preview #3

Closed SpencerDuball closed 1 year ago

SpencerDuball commented 1 year ago

When toggling the preview panel on the MDX editor there will be:

  1. A loading indicator while the preview is rendered server-side.
  2. After the loading is finished, the blog will be rendered correctly.
  3. After this finishes, Remix will reload the page in order to ensure everything is up-to-date.

The issue is that the reload on step 3 will cause the preview to be re-rendered and cause a flash of the preview content.

Might need to cancel the refresh in order to prevent this. There is an unstable unsafe_shouldReload api for this, sounds like this might change in the future.

SpencerDuball commented 1 year ago

Fixed after migrating to Markdoc.