Skip to content

Commit

Permalink
Update 2_components.md
Browse files Browse the repository at this point in the history
  • Loading branch information
unbug committed Aug 24, 2016
1 parent 0299627 commit e9888b7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions 2_components.md
@@ -1,7 +1,7 @@
# 2 Components
1.MyComponent.js

```
```javascript
//define component
class MyComponent extends React.Component {
render() {
Expand All @@ -14,7 +14,7 @@ export default MyComponent;

2.Main.js

```
```javascript
//import component
import MyComponent from './MyComponent';
class Main extends React.Component {
Expand All @@ -26,6 +26,6 @@ class Main extends React.Component {
```
3.AppRegistry

```
```javascript
AppRegistry.registerComponent('MyApp', () => Main);
```

0 comments on commit e9888b7

Please sign in to comment.