How it works...
In step 4, we defined the renderControls function, which renders the UI when the app is first launched. This is the first recipe in which we've used the Picker component. It's a part of the core React Native library and provides the drop-down type selector used to select options in many applications. The selectedValue property is the value tied to whichever item is currently selected in the picker. By setting it to this.state.layoutType, we'll default the selection to the 'default' layout, and keep the values synced when a different Picker item is selected. Each item in the picker is represented by a Picker.Item component. Its label property defines the display text for the item, and the value property represents the string ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access