Skip to content

Replace react-native-toast-view with custom toast#1204

Merged
kevinherdez merged 1 commit into
NWACus:mainfrom
kevinherdez:kevinherdez/toastAndBackFix
Jul 8, 2026
Merged

Replace react-native-toast-view with custom toast#1204
kevinherdez merged 1 commit into
NWACus:mainfrom
kevinherdez:kevinherdez/toastAndBackFix

Conversation

@kevinherdez

Copy link
Copy Markdown
Collaborator

Rusty reported an issue on Android with Expo 56 that the expired forecast toast doesn't seem to respond to taps and the animation is laggy. The new architecture for React Native introduced a new UI rendering framework, Fabric, that changes how RN views are translated to native and these differ between iOS and Android. Since react-native-toast-view hasn't been updated in a year I decided to create our own custom toast view that mimics what we had and addressing these issues.

The two big design descisions with the toast is that it used React Native Gesture Handler instead of Responders so that it captures touches better without blocking other touches, and it does not use react-native-reanimated. The reason being is that Reanimated commits the animation to Android's ShadowTree and on the JS thread instead of the main UI thread like the legacy Animated library from React Native does.

I also changed the ForecastScreen to lazily load the tabs so that it feels more responsive on Android, with the tradeoff that the weather tab and observations tab need to fetch their information on the first load so users will see a loading spinner. Pushing and popping on the nav stack on Android is more expensive than on iOS so this greatly helps performance. However, there's an argument to be made that we only do this on Android.

Before video:
https://github.com/user-attachments/assets/2b06fb15-d2d3-486e-a393-18ae54542378

After video:
https://github.com/user-attachments/assets/ec83afc6-565f-4e98-a950-f39176152d06

@rustynwac

Copy link
Copy Markdown
Contributor

The after vid certainly looks better to me!

@kevinherdez kevinherdez added this pull request to the merge queue Jul 8, 2026
Merged via the queue into NWACus:main with commit d80ac44 Jul 8, 2026
5 checks passed
@kevinherdez kevinherdez deleted the kevinherdez/toastAndBackFix branch July 8, 2026 17:43
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