@unsetsoft/ryunixjs 1.2.5-canary.2 → 1.2.5-canary.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1294,12 +1294,14 @@
1294
1294
 
1295
1295
  if (!activeRoot) return
1296
1296
 
1297
- const newRoot = {
1297
+ currentState.wipRoot = {
1298
1298
  dom: activeRoot.dom,
1299
1299
  props: activeRoot.props,
1300
1300
  alternate: currentState.currentRoot || null,
1301
1301
  };
1302
- queueUpdate(() => scheduleWork$1(newRoot, priority));
1302
+ currentState.deletions = [];
1303
+ currentState.hookIndex = 0;
1304
+ queueUpdate(() => scheduleWork$1(currentState.wipRoot, priority));
1303
1305
  };
1304
1306
 
1305
1307
  wipFiber.hooks[hookIndex] = hook;
@@ -2178,21 +2180,6 @@
2178
2180
  fiber.effectTag = EFFECT_TAGS.HYDRATE;
2179
2181
  }
2180
2182
 
2181
- // Memo bailout: skip re-render if props haven't changed
2182
- if (fiber.type._isMemo && fiber.alternate) {
2183
- const { children: _pc, ...prevRest } = fiber.alternate.props || {};
2184
- const { children: _nc, ...nextRest } = fiber.props || {};
2185
- if (fiber.type._arePropsEqual(prevRest, nextRest)) {
2186
- fiber.hooks = fiber.alternate.hooks;
2187
- const oldChild = fiber.alternate.child;
2188
- if (oldChild) {
2189
- oldChild.parent = fiber;
2190
- fiber.child = oldChild;
2191
- }
2192
- return
2193
- }
2194
- }
2195
-
2196
2183
  let children = [fiber.type(fiber.props)];
2197
2184
 
2198
2185
  if (fiber.type._contextId && fiber.props.value !== undefined) {
@@ -3159,12 +3146,18 @@ function $RC(id, templateId) {
3159
3146
  * @returns {Function} Memoized component
3160
3147
  */
3161
3148
  const memo = (Component, arePropsEqual = shallowEqual) => {
3149
+ let prevProps = null;
3150
+ let prevResult = null;
3151
+
3162
3152
  const MemoizedComponent = (props) => {
3163
- return Component(props)
3153
+ if (prevProps && arePropsEqual(prevProps, props)) {
3154
+ return prevResult
3155
+ }
3156
+ prevProps = props;
3157
+ prevResult = Component(props);
3158
+ return prevResult
3164
3159
  };
3165
- MemoizedComponent._isMemo = true;
3166
- MemoizedComponent._wrappedComponent = Component;
3167
- MemoizedComponent._arePropsEqual = arePropsEqual;
3160
+
3168
3161
  MemoizedComponent.displayName = `Memo(${Component.displayName || Component.name || 'Component'})`;
3169
3162
  return MemoizedComponent
3170
3163
  };