Skip to content

Commit

Permalink
ReactComponent: removed string refs legacy api and deprecated context
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed May 19, 2018
1 parent 3e8f9c6 commit a34e210
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/lib/react/ReactComponent.hx
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,30 @@ typedef ReactComponentProps = {
/**
https://facebook.github.io/react/docs/react-component.html
**/
typedef ReactComponent = ReactComponentOf<Dynamic, Dynamic, Dynamic>;
typedef ReactComponentOfProps<TProps> = ReactComponentOf<TProps, Dynamic, Dynamic>;
typedef ReactComponentOfState<TState> = ReactComponentOf<Dynamic, TState, Dynamic>;
typedef ReactComponentOfRefs<TRefs> = ReactComponentOf<Dynamic, Dynamic, TRefs>;
typedef ReactComponentOfStateAndRefs<TState, TRefs> = ReactComponentOf<Dynamic, TState, TRefs>;
typedef ReactComponentOfPropsAndState<TProps, TState> = ReactComponentOf<TProps, TState, Dynamic>;
typedef ReactComponentOfPropsAndRefs<TProps, TRefs> = ReactComponentOf<TProps, Dynamic, TRefs>;
typedef ReactComponent = ReactComponentOf<Dynamic, Dynamic>;

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

#if react_comp_legacy
// Keep the old ReactComponentOfPropsAndState typedef available for a few versions
// But now we should use ReactComponentOf<TProps, TState> directly
typedef ReactComponentOfPropsAndState<TProps, TState> = ReactComponentOf<TProps, TState>;
#end

#if (!react_global)
@:jsRequire("react", "Component")
#end
@:native('React.Component')
@:keepSub
@:autoBuild(react.ReactComponentMacro.build())
extern class ReactComponentOf<TProps, TState, TRefs>
extern class ReactComponentOf<TProps, TState>
{
var props(default, null):TProps;
var state(default, null):TState;
var context(default, null):Dynamic;

/**
https://facebook.github.io/react/docs/refs-and-the-dom.html
**/
var refs(default, null):TRefs;
@:deprecated
var context(default, null):Dynamic;

function new(?props:TProps, ?context:Dynamic);

Expand Down

0 comments on commit a34e210

Please sign in to comment.