Giter Site home page Giter Site logo

devmtn-girls-study-react-skeleton-code's Introduction

DvMtn26-girls-study-night-practice

Building a React app!

  1. Fork & clone this repository to your computer

  2. What's the file structure of this? Someone walk through how the files are connected

  3. Open Hogwarts.js a. what goes at the top of the file?

    b. what do we have to import to get our styles?

    c. how do we set up the component?

    d. what function must every compnonent have? add it.

    e. what do we add above render to track data in this component?

  4. Add this code to the special function that tracks data: ''' this.state = { crest: 'https://vignette3.wikia.nocookie.net/jspotter/images/1/18/Hogwarts_Crest_1.png/revision/latest?cb=20140720035204' } '''

  5. Inside the return function, create: a. a

    with class name "section" b. inside that, a
    with class name "header-pic" c. inside that
    , add: <img src={'WHAT GOES HERE? hint: we tracked this data in the state...'} alt="Hogwarts crest" /> d. as a sibling to the
    , add an

    with a class name 'header', and make it say 'Welcome to the Sorting Ceremony'

  6. There's one more important line at the end of the file--what is it?


  1. Open Houses.js a. what goes at the top of the file?

    b. what do we have to import to get our styles?

    c. how do we set up the component?

    d. what function must every compnonent have? add it.

    e. what line is missing in the constructor?

    f. create a function called 'updateName' that will update the value of state.currentStudent to a passed in value, 'e'

    g. create a function called 'updateQ1' that will update the value of state.q1 to a passed in value, 'e'

    h. copy/paste the updateQ1 function 3 times, and change the name to be Q2, 3, 4

    i. in the return function, add this code: '''

    Gryffindor crest

    Gryffindor

      { this.state.gryffindor.map(function(listValue){ return
    • {listValue}
    • ; })}
    slytherin crest

    Slytherin

      { this.state.slytherin.map(function(listValue){ return
    • {listValue}
    • ; })}
    Hufflepuff crest

    Hufflepuff

      { this.state.hufflepuff.map(function(listValue){ return
    • {listValue}
    • ; })}
    Ravenclaw crest

    Ravenclaw

      { this.state.ravenclaw.map(function(listValue){ return
    • {listValue}
    • ; })}
             <div className="q-wrapper">
                 <span className="questions">Your Name?</span>
                 <input className="name-input" ///add something to call updateName() whenever I change///></input>
                 <span className="questions">Winter, Spring, Summer, or Fall?</span>
                 <input className="name-input" ///add something to call updateQ1() whenever I change///></input>
                 <span className="questions">Dragon, Unicorn, Phoenix, or Sphinx?</span>
                 <input className="name-input" ///add something to call updateQ2() whenever I change///></input>
                 <span className="questions">You are in a duel--what do you cast? Protego, Expelliarmus, Imperius Curse, or Stupefy?</span>
                 <input className="name-input" ///add something to call updateQ3() whenever I change///></input>
                 <span className="questions">What will be your favorite place in the castle--library, kitchens, forest, or room of requirement?</span>
                 <input className="name-input" ///add something to call updateQ4() whenever I change///></input>
                 <button className="sort-button" ///add something to call sortStudent() whenever I am clicked!///><img src={this.state.sortHat} alt="sorting hat" width="100px"/></button>
             </div>
             
             
         </section> 
    

    '''

    j. don't forget to export me!

  2. Open App.js

  3. How do we get our child components into this file?

  4. How do set this file up?

  5. Add our components in JSX to the return, within a

  6. make sure you're in the right directory and then run 'npm start'!

devmtn-girls-study-react-skeleton-code's People

Contributors

emkeator avatar

Watchers

 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.