Skip to content

Instantly share code, notes, and snippets.

@SergeyLipko
Created May 13, 2017 12:23
Show Gist options
  • Save SergeyLipko/cda76c4940101340cb585fb9a5351476 to your computer and use it in GitHub Desktop.
Save SergeyLipko/cda76c4940101340cb585fb9a5351476 to your computer and use it in GitHub Desktop.
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