Skip to content

sorinalinpavel/react-query

 
 

Repository files navigation

public/docs/logo.svg

Building the real app with React Query

An example of building the app using React Query.

Demo: https://react-query-tutorial.herokuapp.com/

Article: https://www.smashingmagazine.com/2022/01/building-real-app-react-query/

The project is written in TypeScript and uses CRA, React query, axios mock server and material UI for easier prototyping.

Start

  • run yarn in the root folder
  • run yarn build:css to generate tawilwind classes

Functionality

  • Login using email and password and indicate the logged user
  • Show the list of next appointments with load more feature
  • Show information about one particular appointment
  • Save and view changes history
  • Prefetch additional information
  • Add and amend required jobs

Cases covered in the app:

  • Deduping multiple requests for the same data into a single request

    public/docs/deduping.gif

  • Updating "out of date" data in the background (on window focus)

    public/docs/background_fetching.gif

  • Lazy loading list

    public/docs/load_more.gif

  • Prefetching the data

    public/docs/prefetching.gif

  • Mutations and optimistic changes

Success:

public/docs/optimistic_changes_success.gif

Fail:

public/docs/optimistic_changes_fail.gif

  • Suspense and Error Boundaries

public/docs/suspense.gif

The detailed article is coming soon...

About

An example of building the app using React Query.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 79.4%
  • SCSS 15.5%
  • HTML 2.8%
  • JavaScript 1.4%
  • CSS 0.9%