Skip to content

Commit

Permalink
fix: correct memo fiber updater, fixes #1230
Browse files Browse the repository at this point in the history
  • Loading branch information
theKashey committed May 16, 2019
1 parent a6ba488 commit a185494
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/internal/getReactStack.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ReactDOM from 'react-dom';

import hydrateFiberStack from './stack/hydrateFiberStack';
import hydrateLegacyStack from './stack/hydrateLegacyStack';
import { getInternalInstance } from './reactUtils';
import { getInternalInstance, updateInstance } from './reactUtils';

function getReactStack(instance) {
const rootNode = getInternalInstance(instance);
Expand Down Expand Up @@ -41,6 +41,10 @@ const markUpdate = ({ fiber }) => {
...fiber.memoizedProps,
};
}

if (fiber.stateNode) {
updateInstance(fiber.stateNode);
}
};

export const cleanupReact = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/reconciler/componentComparator.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const compareComponents = (oldType, newType, setNewType, baseType) => {
if (oldType.type === newType.type || areSwappable(oldType.type, newType.type)) {
if (baseType) {
// memo form different fibers, why?
if (oldType === baseType) {
if (baseType.$$typeof === newType.$$typeof) {
setNewType(newType);
} else {
setNewType(newType.type);
Expand Down

0 comments on commit a185494

Please sign in to comment.