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

Add warning when measuring flattened view on Android #3414

Merged
merged 2 commits into from
Jul 27, 2022

Conversation

tomekzaw
Copy link
Member

Description

Resolves #3188. See #3188 (comment) for details.

Changes

  • Return array of NaNs instead of zero-length array when Android view is not found in measure
  • Add console.warn with user-friendly message when measure returns NaNs

Test code and steps to reproduce

Copy App.tsx and components/Ripple.tsx from https://snack.expo.dev/@boxedition/ripple-measure-random-values

Checklist

  • Included code example that can be used to test this change
  • Updated TS types
  • Added TS types tests
  • Added unit / integration tests
  • Updated documentation
  • Ensured that CI passes

@tomekzaw tomekzaw requested a review from piaskowyk July 27, 2022 14:45
Copy link
Member

@piaskowyk piaskowyk left a comment

Choose a reason for hiding this comment

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

Well done!

@tomekzaw tomekzaw merged commit 5ca9ad8 into main Jul 27, 2022
@tomekzaw tomekzaw deleted the @tomekzaw/fix-measure-android branch July 27, 2022 15:20
piaskowyk pushed a commit that referenced this pull request Jul 27, 2022
* Return `NaN` instead of non-deterministic values when measuring flattened view on Android

* Add `console.warn`
fluiddot pushed a commit to wordpress-mobile/react-native-reanimated that referenced this pull request Jun 5, 2023
…n#3414)

* Return `NaN` instead of non-deterministic values when measuring flattened view on Android

* Add `console.warn`
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.

[Android] measure giving incorrect values
2 participants