startupjs react-sharedb
Run ShareDB
in React
What it does
- Brings real-time collaboration to React using ShareDB;
- Uses Racer to add a
model
to your app to do any data manipulations; - The
model
acts as a global singleton state, so you can use it as a
replacement for other state-management systems like Redux
or MobX
; - Makes the
render
reactive similar to how it's done in MobX
--
rerendering happens whenever any model
data you used in render
changes.
Installation
It's recommended to just use startupjs
package, since it proxies the API of @startupjs/react-sharedb
.
You don't need to install anything if you are in a StartupJS project.
using react-sharedb
in a pure React project
If you want to use react-sharedb
separately from StartupJS in a pure React project, refer to the following issue. You'll also need to manually setup the sharedb
on your server following its readme instructions. Make sure you use the same sharedb
and racer
versions as used in react-sharedb
, you can check for duplicates using yarn list sharedb racer
.
Requirements
react: 16.9 - 17
Usage with Hooks
Hooks syntax documentation
Usage with Classes
Classes syntax documentation
License
MIT
(c) Decision Mapper - http://decisionmapper.com