Skip to content

Commit

Permalink
fix(react plugin): export typescript interface for better ide support
Browse files Browse the repository at this point in the history
  • Loading branch information
jantimon committed Mar 9, 2020
1 parent 94743d4 commit 753259d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/plugins/react/src/GondelReactComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import { GondelBaseComponent } from "@gondel/core";
import { createRenderableAppWrapper } from "./AppWrapper";
import { isPromise, KeysMatching, UnwrapPromise } from "./utils";

type RenderableReactComponent<State> = StatelessComponent<State> | ComponentClass<State, any>;

export type RenderableReactComponent<State> =
| StatelessComponent<State>
| ComponentClass<State, any>;
type StateOfComponent<T> = T extends RenderableReactComponent<infer V> ? V : never;

interface ConstructableGondelReactComponent<State> {
Expand Down

0 comments on commit 753259d

Please sign in to comment.