robertgonzales / compare-react-state-management

React createContext vs Apollo vs MobX vs Redux in a simple todo app.

Home Page:https://github.com/robertgonzales/compare-react-state-management/tree/master/client/src

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This repo is a collection of apps, structured to compare popular React state management libraries. Each app is the exact same todo app, but uses a different state management library. Presentational components and utils are shared, and business logic and container components are analogous.

I hope this repo is useful to anyone that may already be familiar with one library and interested in another.

Use this repo to compare:

  • How state is updated and components are connected.
  • Boilerplate and configuration.
  • Common and best practices.

Libraries implemented:

How to use:

redux-vs-apollo-example

To run the project:

Start the GraphQL server on localhost:8080/graphql:

$ cd server
$ npm install
$ npm start

Start the React client on localhost:3000:

$ cd client
$ npm install
$ npm start

NOTE: You can select the app to render inside client/src/index.js.

In the future I may add more complex usage examples, especially where one library really excels. For example, optimistic UI is really nice in Apollo and interesting to implement in the others. For now I've just tried to keep everything as simple as possible.

Thanks to igorlima for the GraphQL server: https://github.com/igorlima/todo-mongo-graphql-server

About

React createContext vs Apollo vs MobX vs Redux in a simple todo app.

https://github.com/robertgonzales/compare-react-state-management/tree/master/client/src


Languages

Language:JavaScript 95.6%Language:HTML 3.3%Language:CSS 1.1%