romaindso / react-suspense-demo

3 tiny apps to experiments with React Suspense

Home Page:https://romaindso.github.io/react-suspense-demo/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React Suspense Demo

React Suspense: "A generic way for components to suspend rendering while they load asynchronous data" - Dan Abramov

Demo

https://romaindso.github.io/react-suspense-demo/

3 mini apps to experiments with React Suspense

  • Todolist
  • Pokédex (with images)
  • Component's lazy loading

Use the menu to navigate between these 3 examples.
Refresh the page to see React Suspense in action

Run

npm install
npm start

How to to play with Suspense

  • checkout facebook/react
  • set enableStableConcurrentModeAPIs = true in ReactFeatureFlags.js
  • run yarn build
  • copy build/dist/* to some dir in your project
  • setup alias: {react: ‘dir/react.whatever.js’ (and react-dom, etc) in webpack/parcel/etc config

Credits: @threepointone

License

MIT

About

3 tiny apps to experiments with React Suspense

https://romaindso.github.io/react-suspense-demo/


Languages

Language:JavaScript 96.2%Language:HTML 2.7%Language:CSS 1.1%