From the course: React Native Essential Training
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Generating the random play numbers - React Native Tutorial
From the course: React Native Essential Training
Generating the random play numbers
- [Instructor] We have a target sum it's now time to generate the actual numbers that the player is going to use to sum up to the target. So before we do that, let me talk about my decision to keep this target div in this top level game component and not create a child component just to represent this target div. This is definitely a style preference. If you want this target device to be contained and you want the style of this target div to be contained, then a child component to represent this target div might be worth it. However, a child component to represent this target, div also introduce some complexities. So it's just something that you need to decide on. I decided to keep this target text in this game component for many reasons. But one of them is that it's the only text of this type, the target text. And the other reason is that a lot of the calculations in this game component are going to depend on the value…
Contents
-
-
-
-
-
(Locked)
Introduction and preview42s
-
(Locked)
Initializing the TargetSum app4m 36s
-
(Locked)
Configuring ESLint1m 47s
-
The game component with a random target3m 54s
-
(Locked)
Generating the random play numbers9m 41s
-
(Locked)
Styling the random play numbers2m 23s
-
(Locked)
Using TouchableOpacity for press events6m 17s
-
(Locked)
Changing UI based on selected numbers7m 31s
-
(Locked)
Adding shared behavior to numbers6m 21s
-
(Locked)
Using React DevTools with React Native4m 24s
-
(Locked)
Computing dynamic values where needed5m 14s
-
(Locked)
Changing UI based on game status4m 5s
-
(Locked)
Working with timers6m 16s
-
(Locked)
Caching to optimize computable values8m
-
(Locked)
Remounting a component to reset it7m 30s
-
(Locked)
-
-
-
-