Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const array = [
- { id: 1, title: 'This is title' },
- { id: 2, title: 'This is another one' }
- ]
- const List = () =>
- <div className="list">
- {array.map(item =>
- <Link key={item.id} to={`/item/${item.id}`}>{item.title}</Link>
- )}
- <Route path="/item/:id" component={Preview} />
- </div>
- const Preview = ({item}) => <div>This is list item preview</div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement