-
|
Hi, sorry if it's obvious (haven't really used the lib yet) but was confused why import { useMachine, normalizeProps } from "@zag-js/react"
const service = useMachine(tooltip.machine, { id: "1" })
const api = tooltip.connect(service, normalizeProps)as import { useMachine, normalizeProps } from "@zag-js/react"
const service = useMachine(tooltip.machine, { id: "1" })
const api = tooltip.connect(service)// inside useMachine():
return {
normalizeProps,
...rest,
}
// inside tooltip.connect(service):
service.normalizeProps(...) |
Beta Was this translation helpful? Give feedback.
Answered by
anubra266
Mar 6, 2025
Replies: 1 comment 1 reply
-
|
@scarf005 This separates concerns. useMachine is solely for parsing and running a state machine service |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
segunadebayo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@scarf005 This separates concerns. useMachine is solely for parsing and running a state machine service