Why react components starts with capital letter ?
Abhishek Panwar

Abhishek Panwar @abhishekpanwarrr

About: Full Stack Developer

Location:
India
Joined:
Jun 24, 2022

Why react components starts with capital letter ?

Publish Date: Sep 20 '24
1 0

Do you know why react components start with capital letter????

The reason behind this is, react components written in JSX which internally convert it to react.createElement API. This create element function is convert into plain javascript object. A fundamebtal data structure which is known as React Fiber. This whole happen because of Babel.

Babel takes the component and convert it to a React Fiber object.
When babel encounters a name string with a capital letter it recognise it as a refernece not a string. On contrary every thing else is converted into string

Follow for more tips and topics 😁

Comments 0 total

    Add comment