Join Samer Buna for an in-depth discussion in this video Working with timers, part of React Native Essential Training.
- [Instructor] Implementing a countdown…to track the seconds spent playing this game is easy,…we can just use a regular interval.…The question is do we need to put this…information on the state or not?…And to answer that we need to answer another question…which is do we need to display anything in the UI…while the timer is ticking?…We should probably do that, we should probably display this…remaining seconds, like you start with 10 seconds…and then the counter ticks that down every second…and we should display the number…of remaining seconds in the UI.…
Which means we need to put this number…on the state of the game.…Let's do that.…We'll start with remaining seconds,…I think that's a good name.…And we start with 10.…Of course we can make this configurable if we need to,…if you want to make the game harder.…Just like random number count, we can make this game…receive another property, and maybe a good name…for this property would be something like initial seconds.…This is a number…and it's required.…
And here, instead of hard coding this,…
- Hello React Native on iOS and Android
- Styling React Native components
- Platform APIs
- Building a simple game app and a data-driven app
- Using the Fetch API
- Creating an animation loop
- Testing on Android
- Changing an app logo and a splash screen
- Using TestFlight with internal testers
Skill Level Intermediate
1. Getting Started
2. React Native Fundamentals
Hello React Native on iOS5m 42s
3. Building a Simple Game App
4. Building a Data-driven App
5. Animation and Gesture Control
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.