Skip to content

Fix updating parser when worklet hash doesn't change but closure does change - #607

Merged
tomekzaw merged 1 commit into
mainfrom
@tomekzaw/fix-parser-update
Jan 31, 2025
Merged

tomekzaw merged 1 commit into
mainfrom
@tomekzaw/fix-parser-update

Conversation

@tomekzaw

@tomekzaw tomekzaw commented Jan 30, 2025 •

Copy link
Copy Markdown
Contributor

Details

@289Adam289 reported that MarkdownTextInput formatting does not reflect changes in parser worklet closure after a render. The reason is that currently we call registerParser only when workletHash changes (ignoring the rules of React and ESLint warning).

This PR changes the dependency array of useMemo so that registerParser is called when props.parser reference changes rather than only workletHash.

It is the responsibility of library user to properly memoize the worklet parser

Related Issues

Requires #608.

Manual Tests

Linked PRs

@tomekzaw
tomekzaw requested a review from j-piasecki January 30, 2025 20:18
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.

2 participants