Skip to Content
Full-Stack React Projects - Second Edition
book

Full-Stack React Projects - Second Edition

by Shama Hoque
April 2020
Intermediate to advanced
716 pages
18h 55m
English
Packt Publishing
Content preview from Full-Stack React Projects - Second Edition

The MediaList component

The MediaList component is a reusable component that will take a list of media and iterate through it to render each media item in the view. In MERN Mediastream, we use it to render a list of the most popular media in the home view and a list of media uploaded by a specific user in their profile.

In the view part of the MediaList component, we will iterate through the media array that's received in props using map, as shown in the following code.

mern-mediastream/client/media/MediaList.js:

<GridList cols={3}>    {props.media.map((tile, i) => (        <GridListTile key={i}>          <Link to={"/media/"+tile._id}>            <ReactPlayer url={'/api/media/video/'+tile._id}                width='100%' height='inherit' style=                 {{maxHeight:   '100%'}}/>          </Link> <GridListTileBar ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Full-Stack React Projects

Full-Stack React Projects

Shama Hoque
React Native - The Practical Guide

React Native - The Practical Guide

Academind by Maximilian Schwarzmüller GmbH

Publisher Resources

ISBN: 9781839215414Supplemental Content