Code Monkey home page Code Monkey logo

color-mixer-react-app's Introduction

Color Mixer (Class Components)

This is a project designed to demonstrate how to build Class Components with React.

Getting Started

  1. Fork/clone

  2. npm install

  3. npm start

Questions

Before adding to the application, make sure you can answer the following questions:

  • Take a look at the constructor for the src/App.js file. If you want to access the second color in another method, how would you access it?

  • You'll notice that the colors array is passed through as a prop on a few of the components. How do you expect to be able to access that array within each of those child components?

  • Take a look at the ColorList component. Is this a functional component or a class component? How do you know?

  • View the ColorMixer component and explain what these two lines are doing.

  • Try changing the selected value for a couple of the colors in the App.js file. How does this change the ColorMixer component?

Instructions

To complete the application, we will want to make it so that a user can click on each color and add it to be mixed. When they click again, it will remove that color from the mix. Users should also be able to add new colors via the color picker and form on the right of the screen.

Complete the following:

  • When a user clicks on one of the colors it will cause that color to be selected and thereby mix it with the other colors.

  • When a user clicks on one of the colors that is already a part of the mix, it will remove it from the mix.

  • When a user submits a new color, it will be added to the color list on the left side of the screen.

  • When a user submits a new color, it will clear out the form upon successful submission.

  • BONUS: If the user submits a new color with a name that is less than three characters, the form will not submit.

  • BONUS: As the user types in the name, it will show an error state until more than three characters have been typed.

color-mixer-react-app's People

Contributors

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