GithubHelp home page GithubHelp logo

react_hooks's Introduction

React Hooks

Getting Started

  • Open your command line and navigate to your repos directory (if you do not have a repos folder, then you can use mkdir repos to create one)
  • Use this template repository to start a new project in your repos folder: git clone <repo_name> cd repo_name to navigate into your new repo directory
  • Make sure to run npm install to fetch the dependencies for the project
  • Start Visual Studio Code and select 'Open Folder'. Then select repo_name to open the folder in the editor (or just type code . in your terminal inside the repo directory)
  • Follow the instructions on the README.md file to complete exercises
  • Open the app.js file to get started

Exercise

Overview

  • Our application will be made of two components, App and Overview.
  • Your application should render an input field and a submit button.
  • With the submit button, you can add the content from your input to a “tasks array” that is managed in a state hook.
  • Finally, for each task in the tasks array, an HTML list element should be rendered.
  1. Create a components folder in your src directory and create a file for your component called Overview.js. Overview.js should just render our tasks, while App.js is going to handle the input field with the logic.
  2. With the intended functionality explained, it’s your turn to implement this React app (again). You can do it.
  3. After you get the functionality working, style the app. Practice, practice, practice.
  • REMEMBER: Use the JavaScript function map to map over your tasks array. You will need to provide a unique key to each item (read the warning, you’ll know it when you see it in the console!). And there is a difference between handling input fields in plain JavaScript and in React. Give a whirl and stretch yourself, but fear not, we will again provide an overview of our solution below.

BONUS

  • Add a feature to be able to check off completed tasks
  • Add colors (or indicator of choice) for priority status

react_hooks's People

Contributors

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