-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lesson 02: render multi elements without wrapping
- Loading branch information
1 parent
5edf713
commit 0d4b194
Showing
2 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React, { Component } from 'react'; | ||
|
||
const Fruits = () => [ | ||
<li key="1">Pear</li>, | ||
<li key="2">Weater Melon</li>, | ||
]; | ||
|
||
class App extends Component { | ||
render() { | ||
return [ | ||
<ul> | ||
<li>Apple</li> | ||
<li>Banana</li> | ||
<Fruits /> | ||
</ul>, | ||
<div>this is a div</div>, | ||
]; | ||
} | ||
} | ||
|
||
export default App; |
This file contains 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