To run this example:
npm installoryarnnpm startoryarn 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
aliassection 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
pathssection 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.