mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-29 09:41:45 +00:00
Fixed lint errors.
This commit is contained in:
Vendored
+3
-3
@@ -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>;
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user