Skip to content
This repository was archived by the owner on Mar 5, 2023. It is now read-only.
This repository was archived by the owner on Mar 5, 2023. It is now read-only.

Type support for useService? #48

@danielkcz

Description

@danielkcz

I see that useService is generated in react.d.ts, but I kinda fail to see how to use that.

What I mean is that in the top component I get service reference which is of some kind of type. Now I need to pass it down, but how to specify the type for it in props of the receiving component?

Without the codegen I was used to declaring manually export type TMachineService = Interpreter<TContext, TStates, TEvents> and then used that in declaring type in props. However, now I don't have access to TStates, but I would probably lose a lot of benefits from that anyway.

So what is the idea here?

cc @redappleorigin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions