I've defined a custom node type like so:
export type RuleNodeData = {
blockId: number;
handleOffset?: number;
};
export type RuleNode = Node<RuleNodeData, "ruleNode">;
I'm running into some issues with type support on the useStore hook.
This is how I am using it in my components:
useStore((state: ReactFlowState<RuleNode>) => {})
But I get the following typescript error:
Argument of type '(state: ReactFlowState<RuleNode>) => void' is not assignable to parameter of type '(state: ReactFlowState) => void'.
Types of property 'data' are incompatible.
Property 'blockId' is missing in type 'Record<string, unknown>' but required in type 'RuleNodeData'.ts(2345)
Can anyone see what I'm doing wrong?