[{"id":"reactnativebeginner-001","courseId":"react-native-beginner","domain":"components","topic":"View as the basic container","prompt":"A teammate asks what a View actually becomes when the app runs on iOS or Android. Which answer is correct?","hint":"Think about what the component is on the device, not how it looks in your code.","explain":"Some UI toolkits describe a screen in code and hand the drawing to the operating system. Think about what a container's box and its children become once that happens.","source":"https://reactnative.dev/docs/view","interaction":{"type":"single"},"options":[{"id":"a","text":"The platform's own view, such as UIView on iOS or android.view on Android","why":"View maps directly to the native view equivalent on each platform, so it is the platform's real view."},{"id":"b","text":"A <div> on every platform, because React Native draws through the browser","whyNot":"<div> is the equivalent only when the app runs on the web; View follows whatever platform it runs on."},{"id":"c","text":"A Text node, so its children inherit the font styles","whyNot":"Style inheritance belongs to Text; a View is a container and does not pass font styles down."},{"id":"d","text":"One shared drawing surface that React Native paints on every platform","whyNot":"Components map to each platform's own elements rather than painting one shared surface."}],"answer":"a","explanation":"View maps directly to the platform's native view equivalent, such as UIView or android.view, and can hold any number of children.","concept":"View maps directly to the platform's native view equivalent, such as UIView or android.view, and can hold any number of children.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["A View is a thin container that the platform draws, not a Text element or a drawing canvas."]},{"id":"reactnativebeginner-002","courseId":"react-native-beginner","domain":"components","topic":"Text required around strings","prompt":"A developer assumes text styling works like CSS: in React Native, a fontWeight set on any wrapping component, such as a View, reaches the Text inside it.","hint":"Consider which components the text-style rule is limited to.","explain":"The framework keeps a component's look independent of its surroundings, so text settings are tied to the Text tree they sit in. Consider which elements belong to that tree.","source":"https://reactnative.dev/docs/text","interaction":{"type":"true-false"},"options":[{"id":"a","text":"True","whyNot":"Style inheritance is limited to nested Text elements; a View wrapper does not pass fontWeight to the text inside it."},{"id":"b","text":"False","why":"The page says style inheritance is only encoded inside the native Text component and does not leak to other components."}],"answer":"b","explanation":"Style inheritance in React Native is limited to text subtrees: a nested Text inherits from its parent Text, but other components do not pass text styles down.","concept":"Style inheritance in React Native is limited to text subtrees: a nested Text inherits from its parent Text, but other components do not pass text styles down.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["Set font styles on a Text element, and nest Text inside Text when you want the inner text to inherit them."]},{"id":"reactnativebeginner-003","courseId":"react-native-beginner","domain":"components","topic":"Image source prop","prompt":"An Image receives both a src prop and a source prop, each pointing at a picture. Which one's picture does the component load?","hint":"Look for the prop the docs say outranks the other when both are given.","explain":"When two props both describe where a picture comes from, a fixed ranking settles which one is used. Read the component's notes on precedence, since some props sit above others in that ranking.","source":"https://reactnative.dev/docs/image","interaction":{"type":"single"},"options":[{"id":"a","text":"src","why":"The page says the src prop has precedence over the source prop when both are given."},{"id":"b","text":"source","whyNot":"source acts as the fallback; it does not win over src when both are set."},{"id":"c","text":"Whichever prop appears first in the JSX","whyNot":"The order of props in the JSX has no effect on which picture loads."},{"id":"d","text":"Both are fetched; the faster one shows","whyNot":"The component applies one precedence rule rather than racing two requests."}],"answer":"a","explanation":"When src and source are both given, src wins; srcSet outranks both of them.","concept":"When src and source are both given, src wins; srcSet outranks both of them.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["Check the precedence notes before passing two props that describe the same image."]},{"id":"reactnativebeginner-004","courseId":"react-native-beginner","domain":"components","topic":"TextInput value and onChangeText","prompt":"A search box must react to every character a user types, so it can filter a list as they go. Which TextInput prop gives you the typed text?","hint":"The page names one event as the basic way to read user input.","explain":"A text field can report every change to what the user typed, or it can report milestones in the editing session. Consider which kind keeps an up-to-date copy of the input as the user types.","source":"https://reactnative.dev/docs/textinput","interaction":{"type":"single"},"options":[{"id":"a","text":"onChangeText","why":"onChangeText receives the user's input as it changes, which is the basic way to read what they type."},{"id":"b","text":"onSubmitEditing","whyNot":"It fires when the user submits the field, not on each character typed."},{"id":"c","text":"onFocus","whyNot":"It fires when the input gains focus, before any typing happens."},{"id":"d","text":"onEndEditing","whyNot":"It fires when editing finishes, so it misses the characters typed before that."}],"answer":"a","explanation":"Subscribing to onChangeText receives the user's input as it changes; onSubmitEditing and onFocus only signal particular moments.","concept":"Subscribing to onChangeText receives the user's input as it changes; onSubmitEditing and onFocus only signal particular moments.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["Use onChangeText to keep your own copy of what the user types."]},{"id":"reactnativebeginner-005","courseId":"react-native-beginner","domain":"components","topic":"ScrollView for short content","prompt":"In React Native, setting horizontal to true on a ScrollView arranges its children in a row instead of a column.","hint":"Think about what the prop name suggests and what the default layout is.","explain":"A scroll container's children default to one direction, and a boolean prop can change that arrangement. Consider which way the default runs, and what the flag changes when it is switched on.","source":"https://reactnative.dev/docs/scrollview","interaction":{"type":"true-false"},"options":[{"id":"a","text":"True","why":"With horizontal set to true, the ScrollView's children are arranged horizontally in a row instead of vertically in a column."},{"id":"b","text":"False","whyNot":"The prop is documented to change the layout from a vertical column to a row, so it does affect arrangement."}],"answer":"a","explanation":"The horizontal prop on ScrollView lays its children out in a row instead of the default vertical column.","concept":"The horizontal prop on ScrollView lays its children out in a row instead of the default vertical column.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["Set horizontal on a ScrollView for a horizontal scrolling row; the default is vertical."]}]