GithubHelp home page GithubHelp logo

djgrant / beyonce-app Goto Github PK

View Code? Open in Web Editor NEW
1.0 0.0 23.0 109 KB

Code Your Future exercise app

Home Page: https://github.com/CodeYourFuture/syllabus/blob/scotland/react/lesson3.md

HTML 15.53% CSS 0.62% JavaScript 83.85%

beyonce-app's Introduction

Beyonce App

A tutorial for creating a fun React app.

What we will learn today?

  • Fetching data into components
  • Installing React components from npm
  • How to build an app using react-router

Challenge 1: render a list of albums

Things you will need to know:

Challenge 2: add routes to your app

In this challenge we'll split your app into 3 pages.

In src/components/App/App.js:

  • Copy the react-router imports from the CodeSandbox example over to your app

  • Wrap all of the JSX in a <Router> component

  • Move the content of each of the 3 sections into 3 new components, and then import them as components

  • Add 3 <Route> components, one for each of the compoents you just created. Each <Route> should have a path prop and a component prop.

  • Add a navigation bar to your app with links to the routes you've created

Challenge 3: install components to style your app

React components can be configured with props, which makes them ideal for sharing with others.

There are all sorts of React components that you can install and use in your projects.

In this challenge you'll add a video player to the Album component.

  • Open the Album component

  • Using npm, install react-player

  • Following the instructions on the readme add a react-player component into Album

  • Update your Albums component to pass in a videoUrl to the Album component

  • Add videoUrl as a prop type to the Album component

Homework

  • Find some more content and add another route to your App
  • Using react-router, show the About route content in tabs (see the how this is achieved in https://codesandbox.io/s/p3nww06y00)
  • Enhance the pages using components provided by reactstrap (Bootstrap for React)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.