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

Remove warning when calling measure from RN runtime #4526

Merged
merged 1 commit into from
Jun 5, 2023

Conversation

tomekzaw
Copy link
Member

@tomekzaw tomekzaw commented Jun 2, 2023

Summary

This PR removes a warning that would trigger when measure function was called from the main RN runtime.

The main motivation behind adding this console.warn was to force the developer to explicitly cover the case when measure is called from the RN runtime using if (!_WORKLET) { ... } guard, which, let's be honest, is quite uncomfortable. On the other hand, when measurement cannot be made, e.g. when called from the UI runtime but when the view is not mounted yet, measure returns null, which needs to be handled with if (measured === null) { ... }. It makes sense to merge these two cases since they can be handled identically.

Test plan

@tomekzaw tomekzaw added this pull request to the merge queue Jun 5, 2023
Merged via the queue into main with commit 70fea4d Jun 5, 2023
1 check passed
@tomekzaw tomekzaw deleted the @tomekzaw/remove-measure-warning branch June 5, 2023 13:54
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.

None yet

2 participants