Fixed lint errors.

This commit is contained in:
Søren Bruus Frank
2018-12-20 08:14:10 +01:00
parent ffb95adb27
commit e93e7d6d8d
2 changed files with 8 additions and 9 deletions
+3 -3
View File
@@ -391,7 +391,7 @@ export interface ConnectOptions {
withRef?: boolean;
/**
* The react context to get the store from.
*
*
* @default ReactReduxContext
*/
context?: Context<any>;
@@ -402,7 +402,7 @@ export interface ReactReduxContextObject<SS = any, A extends Action = AnyAction>
storeState: SS;
}
export type ReactReduxContextType<SS = any, A extends Action = AnyAction> = Context<ReactReduxContextObject<SS, A>>
export type ReactReduxContextType<SS = any, A extends Action = AnyAction> = Context<ReactReduxContextObject<SS, A>>;
export interface ProviderProps<A extends Action = AnyAction> {
/**
@@ -411,7 +411,7 @@ export interface ProviderProps<A extends Action = AnyAction> {
store: Store<any, A>;
/**
* Optional context to be used internally in react-redux. Use React.createContext() to create a context to be used.
* If this is used, generate own connect HOC by using connectAdvanced, supplying the same context provided to the
* If this is used, generate own connect HOC by using connectAdvanced, supplying the same context provided to the
* Provider. Initial value doesn't matter, as it is overwritten with the internal state of Provider.
*/
context?: Context<any>;
+5 -6
View File
@@ -1212,25 +1212,24 @@ function TestLibraryManagedAttributes() {
}
function TestProviderContext() {
//Internally in react-redux, null is used initially and overwritten in Provider with store and storeState.
// Internally in react-redux, null is used initially and overwritten in Provider with store and storeState.
const context = React.createContext(null);
class ComponentWithOwnContext extends React.Component {
public static contextType = context;
static contextType = context;
}
<Provider store={store} context={context}>
<ComponentWithOwnContext />;
</Provider>
</Provider>;
class ComponentWithDefaultContext extends React.Component {
public static contextType = ReactReduxContext;
static contextType = ReactReduxContext;
}
<Provider store={store}>
<ComponentWithDefaultContext />
</Provider>;
<Provider store={store} context={null} /> // $ExpectError
<Provider store={store} context={null} />; // $ExpectError
}