Skip to content

fix: reset cached style state in Fabric prepareForRecycle to stop stale-markdown flicker#482

Open
mvanhorn wants to merge 2 commits into
software-mansion:mainfrom
mvanhorn:fix/110-recycled-view-style-reset
Open

fix: reset cached style state in Fabric prepareForRecycle to stop stale-markdown flicker#482
mvanhorn wants to merge 2 commits into
software-mansion:mainfrom
mvanhorn:fix/110-recycled-view-style-reset

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

What/Why?

On the Fabric (new architecture) iOS path, recycled EnrichedMarkdown / EnrichedMarkdownText views kept cached style and md4c-flag state from their previous mount, so a recycled view briefly showed stale markdown (a flicker) before the next props update repainted it. prepareForRecycle now resets the cached style state back to the generated-props baseline, and resets _md4cFlags from that same baseline (not the library default), so a recycled view with md4cFlags.latexMath disabled no longer parses $...$ as math. Fixes #110.

Testing

Change is confined to the iOS prepareForRecycle reset path on the Fabric renderer. Verified by code inspection that the reset now mirrors the reset _props baseline so the subsequent updateProps diff applies the incoming flags correctly. On-device iOS/Android runs and the example app were not exercised in this environment, so the iOS/Android build-and-run checklist items are left unchecked for a maintainer with a simulator to confirm.

PR Checklist

  • Code compiles and runs on iOS
  • Code compiles and runs on Android
  • Updated documentation/README if applicable (none needed for this fix)
  • Ran example app to verify changes: not performed in this environment (no iOS simulator); reset path verified by inspection and review
  • E2E tests are passing
  • Required E2E tests have been added (if applicable)

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.

Cached flicker

1 participant