Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jan 31, 2025

Conversation

tomekzaw
Copy link
Collaborator

@tomekzaw tomekzaw commented Jan 30, 2025

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
@tomekzaw tomekzaw merged commit 5d0d250 into main Jan 31, 2025
5 checks passed
@tomekzaw tomekzaw deleted the @tomekzaw/fix-parser-update branch January 31, 2025 15:34
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