What is an HTML-like JSX element?

Question

In the context of this exercise, what is an HTML-like JSX element?

Answer

An HTML-like JSX element is an element with a lower case tag name. In JSX, lower case tag names will be treated as HTML tags, while upper case tag names will be treated as a component instance.

For instance, lower case <button> is treated as an HTML element, while upper case <Button> would be treated as a component instance of the Button class.

As a consequence of this, React components must always start with a capital letter, or will otherwise be treated as an HTML element.

15 Likes

so if we create a component named “test”, in what way would it treat it… like how are html elements treated verses react component elements?

1 Like

“test” will not be treated neither as a Component Instance nor as an HTML tag because no such HTML tag named “test” exist.
Hence,you might not get an appropriate result.

13 Likes