Advertisement
Guest User

Untitled

a guest
Jul 24th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. const array = [
  2. { id: 1, title: 'This is title' },
  3. { id: 2, title: 'This is another one' }
  4. ]
  5.  
  6. const List = () =>
  7. <div className="list">
  8. {array.map(item =>
  9. <Link key={item.id} to={`/item/${item.id}`}>{item.title}</Link>
  10. )}
  11.  
  12. <Route path="/item/:id" component={Preview} />
  13. </div>
  14.  
  15.  
  16. const Preview = ({item}) => <div>This is list item preview</div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement