Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

images are not rendering on react.js

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.stack.imgur.com/vsNH1.png

and this is the main App.js file:
https://i.stack.imgur.com/P8lY7.png

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

and this is my result:
https://i.stack.imgur.com/mQrFd.png

why is my test component not rendering?

>Solution :

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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading