Last active
May 2, 2019 13:10
-
-
Save zenius/b6574020ee02448d362ce92b9b6e9559 to your computer and use it in GitHub Desktop.
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. | |
All React components must act like pure functions with respect to their props. - React Docs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment