Find: Lowercase Component Name
Find the Mistake Easy
Question
What is wrong with this code?
Code
function myComponent() {
return <div>Hello</div>;
}
function App() {
return <myComponent />;
}
Hint
How does JSX distinguish components from HTML elements?
Explanation
The component name starts with a lowercase letter. JSX treats lowercase tags as HTML DOM elements, not React components. The fix is to rename it to PascalCase: function MyComponent() and use <MyComponent />.
Related Resources
Related Lessons
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.