You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: src/tutorial/00-ReactIntroduction.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,11 @@
2
2
3
3
### Component
4
4
5
-
Components are building block of your UI - similar to directives in angular, or modules and widgets in other frameworks. Components in React are more or less self sufficient in that they constitutes the presentation (HTML) as well as the behavior (eg. event handlers). They are also composable - meaning we can easily use one component within other component. So how do we create a Component? There are couple common ways how you can create a React component.
5
+
Components are building block of your UI - similar to directives in angular, or modules and widgets in other frameworks. Components in React are more or less self sufficient in that they constitute the presentation (HTML) as well as the behavior (eg. event handlers). They are also composable - meaning we can easily use one component within other component. So how do we create a Component? There are couple common ways how you can create a React component.
6
6
7
7
#### 1. React.Component
8
8
9
-
One way to create a React component is to create ES6 `class` and extend `React.Component`. Each component created using this method should have a `render` function that returns what the DOM should look like if this component is rendered on the browser.
9
+
One way to create a React component is to create an ES6 `class` and extend `React.Component`. Each component created using this method should have a `render` function that returns what the DOM should look like if this component is rendered on the browser.
10
10
11
11
```jsx
12
12
importReactfrom'react';
@@ -35,6 +35,6 @@ function Component(props) {
35
35
```
36
36
*Note: Components that are user-defined - meaning the components that you and I write and are not available in the React implementation itself - must have [first letter capital](https://reactjs.org/docs/jsx-in-depth.html#user-defined-components-must-be-capitalized).*
37
37
38
-
The above two approaches are identical except there are certain things that `React.Component` can do that the `function` cannot do but we will park that for now and we'll come back to it later in this tutorial.
38
+
The above two approaches are identical except there are certain things that `React.Component` can do that the `function` cannot do but we will park that for now and come back to it later in this tutorial.
39
39
40
40
Lets build our first `HelloWorld` React Component.
0 commit comments