0

I create a react app and make a test component and I try to render it and it didn't render

this is the component: https://i.sstatic.net/vsNH1.png

and this is the main App.js file: https://i.sstatic.net/P8lY7.png

and this is my result: https://i.sstatic.net/mQrFd.png

why is my test component not rendering?

1
  • Don't post your code as images, please. Commented Nov 12, 2021 at 8:37

1 Answer 1

1

React components must begin with a capital letter. Non-capitalized names are considered by JSX to be just regular HTML tags (like div), so your output markup will be just <test />.

Quoth the JSX documentation:

The first part of a JSX tag determines the type of the React element.

Capitalized types indicate that the JSX tag is referring to a React component. These tags get compiled into a direct reference to the named variable, so if you use the JSX expression, Foo must be in scope.

Your test component must be named Test.

Sign up to request clarification or add additional context in comments.

1 Comment

yeah it solve my error but now it give me another error on web

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.