Challenge - 5 Problems
UI Polish Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
β ui_behavior
intermediateHow does using Flexbox improve UI polish in React Native?
Which of the following best explains why Flexbox helps create polished user interfaces in React Native apps?
Attempts:
2 left
π‘ Hint
Think about how apps look on phones with different screen sizes.
β Incorrect
Flexbox helps arrange UI elements in a flexible way so they adjust nicely on any screen size, which makes the app look polished and professional.
intermediate
Why does smooth navigation improve app polish?
What is the main reason smooth navigation transitions make an app feel polished?
Attempts:
2 left
π‘ Hint
Think about how you feel when an app quickly changes screens without delay.
β Incorrect
Smooth transitions help users understand what is happening, making the app feel faster and more reliable.
β lifecycle
advancedHow does managing component lifecycle improve UI polish?
In React Native, why is properly handling component lifecycle methods important for a polished UI?
React Native
function MyComponent() {
React.useEffect(() => {
// fetch data
return () => {
// cleanup
};
}, []);
return <View><Text>Hello</Text></View>;
}Attempts:
2 left
π‘ Hint
Think about what happens if you donβt clean up timers or listeners in your app.
β Incorrect
Proper lifecycle management avoids UI flickers, memory leaks, and unexpected behavior, keeping the app smooth and polished.
π Syntax
advancedWhich code snippet correctly applies accessibility for a button?
Select the React Native code that best improves accessibility for a button component.
Attempts:
2 left
π‘ Hint
Look for the correct accessibility props used in React Native.
β Incorrect
Using accessible={true} and accessibilityLabel provides screen readers with meaningful info, improving app polish for all users.
π§ Debug
expertWhy does this React Native UI freeze on button press?
Given the code below, why does the app freeze when the button is pressed?
function App() {
const [count, setCount] = React.useState(0);
const handlePress = () => {
while(true) {}
};
return (
{count}
);
}
React Native
function App() {
const [count, setCount] = React.useState(0);
const handlePress = () => {
while(true) {}
};
return (
<View>
<Button title="Press me" onPress={handlePress} />
<Text>{count}</Text>
</View>
);
}Attempts:
2 left
π‘ Hint
Think about what happens when JavaScript runs an endless loop on the main thread.
β Incorrect
An infinite loop blocks the main thread, preventing UI updates and user interaction, causing the app to freeze.
