Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,10 @@ rules:
- devDependencies: ['**/__tests__/**/*.js', tools/**]
no-restricted-imports:
- error
- patterns: ['**/__tests__/**']
- patterns:
- group: ['**/__tests__/**']
- group: ['/react-redux']
message: 'Use our own src/react-redux.js instead.'

import/no-cycle: off # This would be nice to fix; but isn't easy.
import/export: off # This is redundant with Flow, and buggy.
Expand Down
2 changes: 1 addition & 1 deletion src/boot/StoreProvider.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* @flow strict-local */
import React, { PureComponent } from 'react';
import type { Node } from 'react';
import { Provider } from 'react-redux';

import { observeStore } from '../redux';
import { Provider } from '../react-redux';
import * as logging from '../utils/logging';
import { getAccount, tryGetActiveAccountState } from '../selectors';
import store, { restore } from './store';
Expand Down
8 changes: 8 additions & 0 deletions src/react-redux.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/* @flow strict-local */
import type { ComponentType, ElementConfig } from 'react';
/* eslint-disable no-restricted-imports */
// This file is where we type-wrap items from react-redux for use in the
// rest of the codebase.
import {
connect as connectInner,
useSelector as useSelectorInner,
Expand All @@ -9,6 +12,11 @@ import {
import type { PerAccountState, GlobalState, Dispatch, GlobalDispatch } from './types';
import type { BoundedDiff } from './generics';

// There's not a lot to say about the type of `Provider`, and it only has
// one use-site anyway; so we don't wrap it. But do re-export it from here,
// so everything else can uniformly never import directly from react-redux.
export { Provider } from 'react-redux';

/* eslint-disable flowtype/generic-spacing */

// We leave this as invariant in `C` (i.e., we don't write `-C` or `+C`)
Expand Down