Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Use arbitrary componentIdentity
There was no particular reason it was set to element.type. We just wanted to check if something is a render phase update.
  • Loading branch information
gaearon committed Mar 15, 2019
commit 8aee192e27f37ab2080dc2ba0a177e1ed851cd69
4 changes: 2 additions & 2 deletions packages/react-test-renderer/src/ReactShallowRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,6 @@ class ReactShallowRenderer {
let shouldRender = true;
if (
isMemo(element.type) &&
elementType === this._previousComponentIdentity &&
previousElement !== null
) {
// This is a Memo component that is being re-rendered.
Expand All @@ -586,7 +585,8 @@ class ReactShallowRenderer {
if (shouldRender) {
const prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = this._dispatcher;
this._prepareToUseHooks(elementType);
const componentIdentity = {};
this._prepareToUseHooks(componentIdentity);
try {
// elementType could still be a ForwardRef if it was
// nested inside Memo.
Expand Down