Challenge - 5 Problems
Skeleton Screen Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ ui_behavior
intermediate2:00remaining
What will this skeleton loader display?
Consider this React Native component that uses a simple skeleton loader. What will the user see while the data is loading?
React Native
import React from 'react'; import { View, StyleSheet } from 'react-native'; export default function SkeletonLoader() { return ( <View style={styles.container}> <View style={styles.skeletonBox} /> <View style={styles.skeletonLine} /> <View style={styles.skeletonLine} /> </View> ); } const styles = StyleSheet.create({ container: { padding: 20 }, skeletonBox: { width: 100, height: 100, backgroundColor: '#ccc', borderRadius: 8, marginBottom: 10 }, skeletonLine: { height: 20, backgroundColor: '#ddd', borderRadius: 4, marginBottom: 6 } });
Attempts:
2 left
💡 Hint
Look at the backgroundColor and shapes used in the styles.
✗ Incorrect
The component renders a gray square and two gray horizontal bars with rounded corners. These shapes mimic the layout of content placeholders while real data loads.
❓ lifecycle
intermediate1:30remaining
When should you hide the skeleton screen?
In a React Native app, when is the best time to stop showing the skeleton loading screen and display the actual content?
Attempts:
2 left
💡 Hint
Think about when the real content is ready to replace the placeholder.
✗ Incorrect
The skeleton screen should be visible only while data is loading. Once data is ready, the skeleton should be hidden and real content shown.
📝 Syntax
advanced2:30remaining
Which code correctly animates a skeleton loader's opacity?
Which option correctly uses React Native's Animated API to create a pulsing opacity effect for a skeleton loader?
React Native
import React, { useEffect, useRef } from 'react'; import { Animated, View, StyleSheet } from 'react-native'; export default function PulsingSkeleton() { const opacity = useRef(new Animated.Value(1)).current; useEffect(() => { Animated.loop( Animated.sequence([ Animated.timing(opacity, { toValue: 0.3, duration: 700, useNativeDriver: true }), Animated.timing(opacity, { toValue: 1, duration: 700, useNativeDriver: true }) ]) ).start(); }, [opacity]); return <Animated.View style={[styles.skeleton, { opacity }]} />; } const styles = StyleSheet.create({ skeleton: { width: 100, height: 20, backgroundColor: '#ccc', borderRadius: 4 } });
Attempts:
2 left
💡 Hint
Look for the use of Animated.loop and Animated.sequence for continuous animation.
✗ Incorrect
Option A correctly uses Animated.loop with a sequence of timing animations to pulse opacity continuously between 1 and 0.3.
advanced
2:30remaining
How to keep skeleton screen visible during navigation?
In a React Native app using React Navigation, you want to show a skeleton loader on a screen while fetching data. Which approach ensures the skeleton screen remains visible during navigation transitions until data loads?
Attempts:
2 left
💡 Hint
Think about where data is fetched and how props control rendering.
✗ Incorrect
Fetching data in a parent navigator and passing it down allows the screen to show skeleton until data arrives, keeping skeleton visible during navigation transitions.
🧠 Conceptual
expert2:00remaining
Why prefer skeleton loaders over spinners in mobile apps?
Which reason best explains why skeleton loading screens are often better than simple spinners for mobile app user experience?
Attempts:
2 left
💡 Hint
Consider how users perceive waiting and content stability.
✗ Incorrect
Skeleton loaders mimic the shape of content, so users feel the app is responsive and see where content will appear, reducing frustration and layout jumps.