[{"id":"reactnativeintermediate-001","courseId":"react-native-intermediate","domain":"components","topic":"FlatList keyExtractor","prompt":"Your rows come from an API. Each item has an id field and no key field, and you want React keys taken from id. Which FlatList setup does that?","hint":"Ask which prop replaces the default way the list finds each row's identity.","explain":"Lists need a stable identity per row so React can tell rows apart between renders. By default, the list reads a fixed field name from each item, and you can point it at a different field instead.","source":"https://reactnative.dev/docs/flatlist","interaction":{"type":"single"},"options":[{"id":"a","text":"Pass keyExtractor={(item) => item.id}","why":"keyExtractor tells the list which value to use for React keys, so id can be used in place of the default key property."},{"id":"b","text":"Add extraData={item.id} to the FlatList","whyNot":"extraData makes the list re-render when a value changes; it does not choose the React keys."},{"id":"c","text":"Set key={item.id} on the FlatList element","whyNot":"A key on the FlatList element identifies the list itself, not the rows rendered inside it."},{"id":"d","text":"Pass keyExtractor={(item, index) => index}","whyNot":"This uses the position of each row instead of its id, so it does not meet the requirement."}],"answer":"a","explanation":"FlatList uses each item's key prop for React keys by default; keyExtractor overrides that so another field, such as id, can be used.","concept":"FlatList uses each item's key prop for React keys by default; keyExtractor overrides that so another field, such as id, can be used.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["Items without a key field need keyExtractor so the list has stable row identities."]},{"id":"reactnativeintermediate-002","courseId":"react-native-intermediate","domain":"components","topic":"Modal animation types","prompt":"A Modal should visibly animate as it appears. Which TWO animationType values do that?","hint":"The default value is the one that does not move the modal at all.","explain":"A modal can enter the screen in a small set of named motions, chosen by one prop. Presentation on larger iOS devices is handled by a different prop, and the default motion is the plainest one.","source":"https://reactnative.dev/docs/modal","interaction":{"type":"multiple","tellCount":true},"options":[{"id":"a","text":"slide, which slides in from the bottom","why":"slide moves the modal up from the bottom edge of the screen as it appears."},{"id":"b","text":"fade, which fades into view","why":"fade animates the modal's opacity so it gradually becomes visible."},{"id":"c","text":"none, which appears without an animation","whyNot":"none is the default, and it shows the modal instantly with no motion."},{"id":"d","text":"bounce, which springs into place","whyNot":"bounce is not an animationType value; the prop accepts only none, slide and fade."},{"id":"e","text":"pageSheet, which covers a centered portrait-width view","whyNot":"pageSheet is a presentationStyle on iOS, a separate prop that controls how the modal is presented."},{"id":"f","text":"overFullScreen, which covers the screen but allows transparency","whyNot":"overFullScreen is also a presentationStyle, not an animation value."}],"answer":"ab","explanation":"animationType accepts none, slide and fade: slide enters from the bottom, fade fades in, and none appears without animation (the default).","concept":"animationType accepts none, slide and fade: slide enters from the bottom, fade fades in, and none appears without animation (the default).","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["animationType only sets how the modal enters; presentationStyle is a separate iOS prop."]},{"id":"reactnativeintermediate-003","courseId":"react-native-intermediate","domain":"components","topic":"Transparent modal overlay","prompt":"A Modal has transparent set to true and backdropColor set to black. The team expects a dark overlay behind the content. What does the modal actually show behind its content?","hint":"Check what the docs say about the color prop when the boolean is set.","explain":"A modal either draws its own backing over the screen or lets the view beneath it show. A single boolean prop picks between these two looks, and each color setting belongs to only one of them.","source":"https://reactnative.dev/docs/modal","interaction":{"type":"single"},"options":[{"id":"a","text":"backdropColor is ignored; the background is transparent","why":"transparent renders the modal over a transparent background, and backdropColor is ignored when transparent is true."},{"id":"b","text":"A black overlay, because backdropColor sets the backdrop","whyNot":"backdropColor is ignored when transparent is true, so no black backdrop is drawn."},{"id":"c","text":"A white overlay, because white is the default backdrop","whyNot":"White is the default only when transparent is false; with transparent set, the color is not used."},{"id":"d","text":"An error, because the two props cannot be combined","whyNot":"The page describes backdropColor as ignored in this case, not as a conflict that raises an error."}],"answer":"a","explanation":"Setting transparent to true renders the modal over a transparent background, and backdropColor is ignored in that case.","concept":"Setting transparent to true renders the modal over a transparent background, and backdropColor is ignored in that case.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["backdropColor only applies when transparent is false."]},{"id":"reactnativeintermediate-004","courseId":"react-native-intermediate","domain":"components","topic":"Pressable pressed-state styling","prompt":"You set unstable_pressDelay to 200 on a Pressable, then a user taps it briefly. Put these steps in the order the Pressable reports them.","hint":"Ask which callbacks need the contact to have started, and which need it to have ended.","explain":"A pressable reports an interaction as a few named stages, each a point where a handler can run. Some stages need the contact to have begun, while others need it to have ended.","source":"https://reactnative.dev/docs/pressable","interaction":{"type":"sort","items":[{"text":"The finger goes down","why":"Pressing down starts the unstable_pressDelay wait, and the page places that wait before onPressIn."},{"text":"onPressIn fires","why":"Called once the delay after press down has passed, before onPressOut and onPress."},{"text":"onPressOut fires","why":"Called when the touch is released, which ends the press gesture."},{"text":"onPress fires","why":"Called after onPressOut, so it runs once the release has happened."}]},"options":[],"answer":"o:abcd","explanation":"With unstable_pressDelay set, onPressIn is called only after that delay following press down; onPressOut runs when the touch is released, and onPress runs after onPressOut.","concept":"With unstable_pressDelay set, onPressIn is called only after that delay following press down; onPressOut runs when the touch is released, and onPress runs after onPressOut.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["onPress is called after onPressOut, so it runs after the release."]},{"id":"reactnativeintermediate-005","courseId":"react-native-intermediate","domain":"components","topic":"KeyboardAvoidingView behavior prop","prompt":"A login form uses KeyboardAvoidingView with behavior set to 'padding'. The team adds a top margin through contentContainerStyle, but nothing changes. What explains this?","hint":"Check which of the wrapper's props the style depends on.","explain":"A keyboard-aware wrapper makes room in one of several ways, chosen by one enumerated prop. Before a style can affect the content, check whether that style belongs to the chosen way.","source":"https://reactnative.dev/docs/keyboardavoidingview","interaction":{"type":"single"},"options":[{"id":"a","text":"contentContainerStyle only applies when behavior is 'position'","why":"The container's style is used only in position mode, so padding mode does not apply this margin."},{"id":"b","text":"keyboardVerticalOffset adds a margin to the content container","whyNot":"keyboardVerticalOffset is the distance between the top of the screen and the view; it does not style the container."},{"id":"c","text":"The style only applies when enabled is set to false","whyNot":"enabled turns the component on or off and defaults to on; it does not gate the container style."},{"id":"d","text":"The style only applies after the keyboard has been dismissed","whyNot":"The page ties the container style to behavior, not to whether the keyboard is visible."}],"answer":"a","explanation":"contentContainerStyle applies only when behavior is 'position'.","concept":"contentContainerStyle applies only when behavior is 'position'.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["Set behavior explicitly on both iOS and Android, since the page recommends it."]}]