Fix (#4430): Use separate hooks for shell mode animated styles #4451
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is just a silly "move stuff around" PR and is small step towards improving the perceived performance on low end devices.
This PR is based on the findings reported in #4430 and replaces the hook
useMinimalShellMode
with 3 separate hooks dedicated to building the animated style (for footer, header and Fab buttons)This avoids creating 3 instances of the hook
useAnimatedStyle
of which only one is actually needed every time the hook is used, and reduces the first render time for components using the transitions on low end Android devices.I tested for regressions for both iOS and web too, and found none, hence I updated the
.web
components aswell for consistency, but I'm not 100% familiar with simultaneous web/mobile development using RN so let me know if it's ok.Also, I preferred to keep 3 hooks in the base
hooks
folder but I'm ok with equivalent alternatives.Fixes #4430