Skip to content

Commit

Permalink
Use Empty typedef instead of Void, fixes some edge cases
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Jan 7, 2019
1 parent 3ae13ca commit ea365dd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/lib/react/Empty.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package react;

typedef Empty = {}

4 changes: 2 additions & 2 deletions src/lib/react/ReactComponent.hx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ typedef ReactComponentProps = {
**/
typedef ReactComponent = ReactComponentOf<Dynamic, Dynamic>;

typedef ReactComponentOfProps<TProps> = ReactComponentOf<TProps, Void>;
typedef ReactComponentOfState<TState> = ReactComponentOf<Void, TState>;
typedef ReactComponentOfProps<TProps> = ReactComponentOf<TProps, Empty>;
typedef ReactComponentOfState<TState> = ReactComponentOf<Empty, TState>;

// Keep the old ReactComponentOfPropsAndState typedef available a few versions
typedef ReactComponentOfPropsAndState<TProps, TState> = ReactComponentOf<TProps, TState>;
Expand Down

0 comments on commit ea365dd

Please sign in to comment.