Recall & Review
beginner
What is a Picker component in React Native?
A Picker is a dropdown menu that lets users select one option from a list. It looks like a spinning wheel or dropdown on mobile devices.
Click to reveal answer
beginner
How do you import the DateTimePicker in React Native?You import it from '@react-native-community/datetimepicker' package using: <br><code>import DateTimePicker from '@react-native-community/datetimepicker';</code>Click to reveal answer
beginner
What prop controls the mode of the DateTimePicker?
The
mode prop controls whether the picker shows a date, time, or both. Values can be 'date', 'time', or 'datetime'.Click to reveal answer
beginner
How do you handle the selected value from a Picker?
You use the
onValueChange prop to get the selected value and update your component's state to reflect the choice.Click to reveal answer
intermediate
Why should you use accessibility labels with Picker and DateTimePicker?
Accessibility labels help screen readers describe the picker to users with disabilities, making your app usable by everyone.
Click to reveal answer
Which prop sets the selected value in a React Native Picker?
✗ Incorrect
The
selectedValue prop sets the current selected option in a Picker.What package do you install to use DateTimePicker in React Native?
✗ Incorrect
The official DateTimePicker is from '@react-native-community/datetimepicker'.
Which mode shows only the time in DateTimePicker?
✗ Incorrect
The mode 'time' shows only the time selection.
How do you open the DateTimePicker on Android?
✗ Incorrect
On Android, you usually control visibility with a button press that sets a state to show the picker.
Which accessibility prop helps screen readers identify a Picker?
✗ Incorrect
The
accessibilityLabel describes the Picker for screen readers.Explain how to implement a Picker in React Native and handle user selection.
Think about how you show options and save the chosen one.
You got /4 concepts.
Describe how to use DateTimePicker to select a date and time in a React Native app.
Consider how you open the picker and get the chosen date or time.
You got /5 concepts.