Code Monkey home page Code Monkey logo

demo-react-hooks-final-state's Introduction

๐ŸŽฃ Hooks Demo

This is the final state of the app from the session, having added some state management using useState, an API call using useEffect and some basic state sharing using useContext.

Have an explore of the app to make sure you understand the basic structure of the components.

Notes

๐Ÿ‘‰ This is a React app created with Create-React-App.

๐Ÿ‘‰ We've added a package called tailwind to simplify the CSS. Tailwind gives us some handy reusable classes just like we talked about in our CSS sessions, which makes component development very fast and consistent.

๐Ÿ‘‰ We've structured the app with a nice tidy App component, and then a Layout we can reuse for different pages when we add new functionality, and split all our components into their own folder.

๐Ÿ‘‰ We've also added a <LoadingIndicator/> using a publicly available npm library called react-spinner-kit. We're not using it yet, but it'll come in useful to make our app look nice once we add some functionality that needs it. (Try importing the <LoadingIndicator/> component in the app somewhere and reloading to have a look at it, if you're curious.)

๐Ÿ‘€ (You may notice that we haven't added any testing, but this is just a demo..! If this were a real app, we'd definitely be adding our .test.tsx files for each component! ๐Ÿงช๐Ÿ‘ฉโ€๐Ÿ”ฌ)

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

demo-react-hooks-final-state's People

Contributors

neil-hughes 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.