This talk was presented during the React Native EU 2021 - the largest community conference in the world focused exclusively on React Native.
Abstract:
Most of the people watching this talk have some sort of connection to React-Native, either by playing around with it or by doing it professionally. This talk will show alternative approach on how to build React-Native apps which you might not have tried before or even though of. My story started two years ago, together with a friend we made an app to scratch our own itch, we wanted to listen to more podcasts. One of the things we tried was to listen to podcast while working out, which works fine when you go slow or rest between sets, but when you're going at it, it's hard to focus on the podcast or if you focus on the podcast you can get injured (I once started laughing from podcast in the middle of a squat rep, I do not recommend that 😅). Our solution was to create an app that plays music when you go at it and plays podcast when you rest or go slow - combined with a workout timer.
The interesting part here is that both playing music and podcast is done using native iOS and Android code. Together with playing audio we also have to run the workout timer on the native thread so if the app is put to background the timer still runs. The way we started architecture this app was to have a control center on the javascript side that emits events to the native side when its time to play music and when its time to play podcast, as well as an event listing to the timer running on the native thread.
Emitting events back and fourth over the bridge just to keep the native and the javascript in sync is not sufficient and error prone. So we did what any sane developer would do, we did a re-write! We moved all the logic from the control center to the native side and we also moved the counter UI to the native side.
In this talk I will go through how we did it from an Android perspective and I hope you might think of ways to optimise your app by levering the native side 🤞🏼
Speaker bio:
Been building software products for the last 10 years. I've been shipping more than five different apps using React-Native and I have been part of teams maintaining several React-Native apps for years. Currently building https://www.shiftfm.app/ and https://kron.no/
Twitter: / trulsskeie
Github: http://github.com/skeie
Additional links: Slides: https://docs.google.com/presentation/...
Show case app: https://www.shiftfm.app/
"
Watch video React Native EU 2021: Truls Skeie - React Native going Native online without registration, duration hours minute second in high quality. This video was added by user Callstack Engineers 20 October 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 1,136 once and liked it 30 people.