Skip to content

fix(editor): reload preview as well when initialValue is changing#100

Merged
perber merged 1 commit into
mainfrom
fix/97-preview-stays-the-same-after-changing-site
Jun 17, 2025
Merged

fix(editor): reload preview as well when initialValue is changing#100
perber merged 1 commit into
mainfrom
fix/97-preview-stays-the-same-after-changing-site

Conversation

@perber
Copy link
Copy Markdown
Owner

@perber perber commented Jun 17, 2025

No description provided.

Copilot AI review requested due to automatic review settings June 17, 2025 21:17
@perber perber linked an issue Jun 17, 2025 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR aims to fix the issue where the markdown preview does not reload when the initial content value changes.

  • Added a useEffect hook to re-sync the markdown state with the initialValue prop.
Comments suppressed due to low confidence (1)

ui/leafwiki-ui/src/features/editor/MarkdownEditor.tsx:57

  • [nitpick] Consider adding a comment above the useEffect hook to explain that it is intended to sync the markdown state with the initialValue prop, ensuring that the preview reloads correctly when the prop changes.
  useEffect(() => {

@perber perber force-pushed the fix/97-preview-stays-the-same-after-changing-site branch from 324200b to 72e547b Compare June 17, 2025 21:30
@perber perber merged commit c0908f1 into main Jun 17, 2025
4 checks passed
@perber perber deleted the fix/97-preview-stays-the-same-after-changing-site branch June 17, 2025 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The preview stays the same after changing the site

2 participants