0
0
React Nativemobile~20 mins

Project structure overview in React Native - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Project Structure Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding the purpose of the 'src' folder
In a React Native project, what is the main purpose of the 'src' folder?
ATo store all source code files like components, screens, and utilities
BTo keep configuration files like package.json and babel.config.js
CTo hold compiled JavaScript files for production
DTo store image assets and fonts only
Attempts:
2 left
💡 Hint
Think about where you write your app's main code.
ui_behavior
intermediate
2:00remaining
Effect of placing components outside 'src' folder
What happens if you place React Native components outside the 'src' folder in a typical project?
AThe app will not run because components must be inside 'src'
BThe app runs fine but it becomes harder to organize and maintain code
CThe app will crash on startup due to missing components
DThe components will automatically be ignored during build
Attempts:
2 left
💡 Hint
Think about code organization and build process.
lifecycle
advanced
2:00remaining
Role of 'App.js' in project structure
In a React Native project, what is the role of the 'App.js' file in the project structure?
AIt is the main entry point that registers the root component for the app
BIt contains only styles and no functional code
CIt is used to configure native Android and iOS settings
DIt stores environment variables for the app
Attempts:
2 left
💡 Hint
Think about what starts the app when it launches.
navigation
advanced
2:00remaining
Where to place navigation files in project structure
Where is the best place to put navigation-related files in a React Native project?
AIn the root project folder alongside package.json
BMixed directly inside the 'components' folder
CInside a dedicated 'navigation' folder within 'src' for clear separation
DInside the 'assets' folder with images
Attempts:
2 left
💡 Hint
Think about keeping related files organized.
🔧 Debug
expert
2:00remaining
Identifying cause of 'module not found' error
You moved a component file from 'src/components' to 'components' at the root level but now get a 'module not found' error when importing it. What is the most likely cause?
AThe Metro bundler cache was cleared accidentally
BReact Native does not allow components outside 'src'
CThe moved file lost its file extension during move
DThe import path in other files was not updated to reflect the new location
Attempts:
2 left
💡 Hint
Check import statements after moving files.