Giter Club home page Giter Club logo

birthday-reminder's Introduction

Birthday Reminders

Live Site: https://birthday-reminder.andrejarboe.com/

This is a React application that displays a list of people with birthdays on the current day. It contains a main component called App that displays the list of people and a button to clear the list, and a subcomponent called List that displays the people.

How useState is utilized

The useState hook is used in the App component to manage the state of the list of people.

  • It initializes the state with the imported data, and provides a function to update the state when the clear button is clicked.

The state is destructured into two variables: people and setPeople.

  • The first is the current value of the state, and the second is a function to update it.
  • The setPeople function is passed to the onClick event of the clear button, and when the button is clicked, it sets the value of people to an empty array, effectively clearing the list.

File structure

The application has two core react files:

  • App.js: This is the main component that renders the list of people and the clear button. It imports the List component and the data from the data.js file.

  • List.js: This is a functional component that takes the list of people as a prop and renders an article element for each person with their name, age, and image.

Running the application

To run this application, you will need to have React installed on your system.

Clone this repository. Navigate to the cloned directory. Run npm install to install the necessary dependencies. Run npm start to start the development server.

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.