Skip to content

Commit

Permalink
Use multiple instances of the fake component
Browse files Browse the repository at this point in the history
We mutate the inner component for its name so we need multiple copies.
  • Loading branch information
sebmarkbage committed Apr 6, 2020
1 parent 347b276 commit afb7bc5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/react-devtools-shared/src/__tests__/store-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -856,16 +856,20 @@ describe('Store', () => {

const MyComponent = (props, ref) => null;
const FowardRefComponent = React.forwardRef(MyComponent);
const MyComponent2 = (props, ref) => null;
const FowardRefComponentWithAnonymousFunction = React.forwardRef(() => (
<MyComponent />
<MyComponent2 />
));
const MyComponent3 = (props, ref) => null;
const FowardRefComponentWithCustomDisplayName = React.forwardRef(
MyComponent,
MyComponent3,
);
FowardRefComponentWithCustomDisplayName.displayName = 'Custom';
const MemoComponent = React.memo(MyComponent);
const MyComponent4 = (props, ref) => null;
const MemoComponent = React.memo(MyComponent4);
const MemoForwardRefComponent = React.memo(FowardRefComponent);
const LazyComponent = React.lazy(() => fakeImport(MyComponent));
const MyComponent5 = (props, ref) => null;
const LazyComponent = React.lazy(() => fakeImport(MyComponent5));

const App = () => (
<React.Fragment>
Expand Down

0 comments on commit afb7bc5

Please sign in to comment.