GithubHelp home page GithubHelp logo

fizreal / u4_lab_conditional_rendering Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sei-r-4-24/u4_lab_conditional_rendering

0.0 0.0 0.0 358 KB

In this lab, we'll use provided state and a form to conditionally render different components based on user input.

JavaScript 88.31% CSS 4.77% HTML 6.92%

u4_lab_conditional_rendering's Introduction

Conditional Rendering Lab

Bale

Overview

In this lab, we'll be working with a provided sign-up form to conditionally render components based on the user's input.

Getting Started

  • Fork and Clone
  • cd into u4_lab_conditional_rendering.
  • Open up in VSCode with code .
  • npm i to install our dependencies.
  • npm run dev to spin up the app
  • Navigate to localhost:5173 in your browser

Instructions

Using the provided components, we're going to create an environment where:

  • The user will go through three "pages" of a sign up process (Landing, Form, then Thanks or Error)
  • Once you hook them up, the buttons on each page will navigate the user through the process
  • The Next button should not clickable unless all 3 fields on the form have user input. Disabled could be helpful!
  • The Thanks component renders when a user over the age of 18 signs up OR the Error component renders when a user under the age of 18 tries to sign up

What We're Trying to Build (scroll to the right)

             
  
  1. A landing page that welcomes the user to our site
  2. A Form that allows them to "sign up"
  3. If everything is filled out correctly, a Thank You page that thanks them for signing up
  4. An Error page that appears if the user does not meet the age requirement

Notes/Tips

  • Take a look at what is already provided in the app. Using the state we have, how could we decide which components to render under certain conditions?
  • Consider the many conditional statements we've used throughout this course (if/else, switch, ternary). Which would be best for this situation?
  • The app will not render any components until you've called them in the Home.jsx render statement...
  • The majority of your work will be done in Home.jsx.

Bonus

  • Configure the Back buttons to reset the state and return to the welcome page. Maybe a helper method in the App component could be useful?
  • Style it up!

Resources

u4_lab_conditional_rendering's People

Contributors

mrjanhorak 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.