automerge/examples/cra
2022-01-31 10:55:45 -07:00
..
public add cra example code 2022-01-28 18:05:33 -05:00
src Update app to include text editor, import Automerge correctly 2022-01-31 10:55:45 -07:00
.gitignore add cra example code 2022-01-28 18:05:33 -05:00
package.json remove from package.json 2022-01-28 18:58:47 -05:00
README.md add cra example code 2022-01-28 18:05:33 -05:00
tsconfig.json add cra example code 2022-01-28 18:05:33 -05:00

Example CRA App using AutomergeWASM

Creating this example app

   $ cd automerge-wasm && yarn pkg # this builds the npm package
   $ cd ../examples
   $ npx create-react-app cra --template typescript
   $ cd cra
   $ npm install ../../automerge-wasm/automerge-wasm-v0.1.0.tgz

Then I just needed to add the import "automerge-wasm" and { useEffect, useState } code to ./src/App.tsx

    $ npm start

Open Issues

The example app currently doesn't do anything useful. Perhaps someone with some react experience and figure out the right way to wire everything up for an actual demo.