Code Monkey home page Code Monkey logo

lab-react-toggle's Introduction

React Toggle Boards Lab

Toggle Boards Exercise

In this lab you're given starter that displays three boards with borders and a toggle button. Your task is to fill in the code that will make the next board become active (have a green border), when the toggle button is clicked. A description of the behavior is below

  • Initially, the first board is active and has a green border.
  • When you press the toggle button, the second board should be active, and the first one should be inactive.
  • When you reach the last board, and you press the toggle button, the first one should become active again.
  • For a working solution see: https://cunytechprep.github.io/lab-react-toggle-solution/

To start off and understand the desired toggle effect, try changing let isSelected = ii === 0; to let isSelected = ii === 1;

Tasks

  • change the app to render 5 boards
  • add state to track current selection
  • add an event handler for the toggle button

To submit

  • Make a fork of this repository
  • Clone your own fork
  • Solve the lab
    • to get started run npm install once to install the packages
    • to start the react app install npm start
  • Commit and push your code to your forked repository
  • Make a pull request back to this repository
    • Mention your Instructor and TA's names in your pull request message

Credit

This lab is based on and a React 18 / ES6 update to the excellent tutorial found at: https://buildwithreact.com/

lab-react-toggle's People

Contributors

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