Skip to content

Instantly share code, notes, and snippets.

const element = <Welcome name="Sara" />;
When React sees an element representing a *user-defined component*,
it passes *JSX attributes* to this component as a single object. We call this object *“props”*.
When an element type starts with a lowercase letter, it refers to a built-in component like <div> or <span>
and results in a string 'div' or 'span' passed to React.createElement.
**Types that start with a capital letter like <Foo /> compile to React.createElement(Foo)**
and correspond to a component defined or imported in your JavaScript file.
1. Push logic upwards / Keep it dumb - it(refers to Reusable Component)
2. Allows extra props to be passed into the component.
<!--
Software development is an art and it is not all about writing code, it is all about writing good code.
As I love to say software development is not about getting to the end goal, it is a journey and getting to that
understanding makes life more interesting
as you strive to not only get to the end but also understand everything that
will lead you to the end of your goal. Happy Coding!