Podcast
Questions and Answers
Which of the following is a benefit of using JSX in React components?
Which of the following is a benefit of using JSX in React components?
- It is a rule that must be followed
- It reduces the number of lines in a file
- It allows for easy reuse of components
- It makes it easy to build a UI (correct)
Where can a React component be created?
Where can a React component be created?
- In the same file as another component only
- In either its own file or the same file as another component (correct)
- In its own file only
- In a separate folder
Why would you create a React component in its own file?
Why would you create a React component in its own file?
- To make it easier to import and reuse (correct)
- To reduce the number of lines in a file
- To separate concerns
- To follow a rule in React development
When would you create a React component in the same file as another component?
When would you create a React component in the same file as another component?
What determines whether to create a React component in its own file or the same file as another component?
What determines whether to create a React component in its own file or the same file as another component?