This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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! |
NewerOlder