state-designer icon indicating copy to clipboard operation
state-designer copied to clipboard

Using wrong method name in a Sandbox example

Open Marwa-Da opened this issue 1 year ago • 0 comments

Hi Stev,

In the tip box of this link, there's a Sandbox example where it has the following lines which are not correct:

import { createStateDesigner, useStateDesigner } from "@state-designer/react"

// [1]
const counter = createStateDesigner({
	data: { count: 0 },
	on: { CLICKED: data => data.count++ },
})

I suggest replacing them with the following lines so the example would work:

import {  useStateDesigner } from "@state-designer/react"
import { createState } from "@state-designer/core"
// [1]
const counter = createState({
	data: { count: 0 },
	on: { CLICKED: data => data.count++ },
})

P.S. I would like to thank you so much for your packages and for your creativity <3

Marwa-Da avatar Dec 29 '22 12:12 Marwa-Da