โ† React Native
#4 most askedVery commonEasyFundamentals

Styling and Flexbox in React Native

New to Fundamentals? Learn it from scratch first
Thinking in React: UI = f(state) โ†’
๐Ÿข Asked in real interviews
No reports yet. Were you asked this? Be the first to say where.
I was asked this

How is styling in React Native different from CSS on the web?

๐Ÿ”ฎ Predict the output

// Simulate how React Native merges a style array: later entries win, falsy ones are skipped
const flatten = (styles) => Object.assign({}, ...styles.filter(Boolean));
const base = { padding: 12, backgroundColor: "white", flexDirection: "column" };
const active = { backgroundColor: "teal" };
const isActive = false;
console.log(flatten([base, isActive && active, { padding: 20 }]));

๐ŸŽค Answer it out loud, then check yourself

Say your answer as if the interviewer is listening (30โ€“90 seconds). Then reveal what a strong answer covers and tick what you said.

    Answer out loud first, then compare.
    Want to rehearse it?
    Answer this to the AI interviewer and get a verdict โ†’