Skip to content

Usage with Preact

Cassio Zen edited this page May 20, 2021 · 1 revision

useStateMachine works out-of-the box if you have preact/compat set up (as is the default in wmr and preact-cli).

Otherwise you need to alias "react" to "preact/hooks" - for example, in your package.json:

"moduleNameMapper": {
  "^react$": "preact-compat",
  "^react-dom$": "preact-compat",
}
Clone this wiki locally