From the course: React Native Essential Training

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Generating the random play numbers

Generating the random play numbers - React Native Tutorial

From the course: React Native Essential Training

Start my 1-month free trial

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