Created
May 13, 2017 12:23
-
-
Save SergeyLipko/cda76c4940101340cb585fb9a5351476 to your computer and use it in GitHub Desktop.
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
import React from 'react'; | |
const names = [{name: 'Arsen'}, {name: 'Vazgen'}, {name: 'Vlad'}]; | |
const User = ({ name, ...rest }) => { | |
return ( | |
<div> | |
<span> | |
{ name } | |
</span> | |
{ rest.names.map(i => <div> {i.name} </div>) } | |
</div> | |
) | |
}; | |
class App extends React.Component { | |
render() { | |
return ( | |
<div> | |
<User name="Villy" names={names}/> | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment