Skip to content

About

example app showing how react suspense works using tvmaze api

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

React Suspense & Lazy import example

This project uses React 16 Suspense and lazy imports (briefly explained here) to make a simple tv show search app.

The idea is to stop pushing data fetching up into containers, and recouple data fetching with the components that actually use it.

The "greppable" techniques in this project are:

  • React.Suspense - a HOC that handles a fallback component when data (or a lazy component) are loading
  • React.lazy - wraps a function returning a component dynamically imported
  • unstable_createResource - a caching mechanism that takes a function with an id as a parameter returning a promise. It also can block rendering on a component wrapped in React.Suspense

About

example app showing how react suspense works using tvmaze api

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages