To run this example:
npm install
oryarn
npm start
oryarn start
For local development, you'll have to update package.json
and tsconfig.json
:
package.json
-
Remove everything but "react-dom" from
dependencies
-
Add an
alias
section pointing to usestatemachine in the dist folder and React from the main node_modules.
"alias": {
"react": "../../node_modules/react",
"scheduler/tracing": "../../node_modules/scheduler/tracing-profiling",
"@cassiozen/usestatemachine": "../../dist"
},
tsconfig.json
- Add a
paths
section pointing to usestatemachine in the dist folder.
"paths": {
"@cassiozen/usestatemachine": ["../../dist/index"],
},
Finally, run npm start
on both the root library and on this example folder.