Open
Description
What version of this package are you using?
0.11.0-canary.1
What operating system, Node.js, and npm version?
Macos Node16
What happened?
Failed to infer Type when using Union Types
import createStore from "teaful";
type TypeOne = {
param1: string;
param2: string;
};
export const { useStore } = createStore<TypeOne | Pick<TypeOne, "param1">>();
const Test = () => {
const [test] = useStore({ param1: "hello" });
// Error: Type Inference Failed
if (test.param2) {
return <div>{test.param2}</div>;
}
return <div>{test.param1}</div>;
};
export default Test;
Metadata
Assignees
Labels
No labels