Giter Site home page Giter Site logo

react-props-lab-v-000's Introduction

React Props lab

Overview

In this lab, you'll define components with default props and you'll also override default props with your own prop values.

Star Wars

Millennium Falcon

Let's say we're a spaceship captain going to a local Star Wars meetup. Since we want to showcase the awesome ships people are commandeering, we need to represent them somehow. That's where you come in! You'll be creating a React component that shows us some info on a given spaceship.

  1. In the components/Spaceship.js file, create a Spaceship React component
  2. This component has several props:
    1. name (string)
    2. speed (number)
    3. hasRockets (boolean, defaults to false)
    4. colors (array of strings, defaults to ['black', 'red'])

Feel free to render out the data in any form you wish!

Note: you'll need to export the Spaceship component, like this:

module.exports = class Spaceship extends React.Component { ... };
// OR
module.exports = React.createClass({ ... });
// OR declare your component first, and then:
module.exports = Spaceship;

Resources

react-props-lab-v-000's People

Contributors

thomastuts avatar annjohn avatar storywr avatar pletcher avatar

Watchers

James Cloos avatar  avatar

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.