@samitouri / QOS-React / commits / a130757cd3

Remove hidden functional shouldComponentUpdate API (#10371)

Dan Abramov committed Aug 3, 2017 at 20:24 UTC a130757cd3ed80047c5eed0afdcdf0d2f90343a0
1 file changed +2 -10
src/renderers/shared/fiber/ReactFiberBeginWork.js
+2 -10
@@ -198,16 +198,8 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
198 if (nextProps === null || memoizedProps === nextProps) {
199 return bailoutOnAlreadyFinishedWork(current, workInProgress);
200 }
201 - // TODO: Disable this before release, since it is not part of the public API
202 - // I use this for testing to compare the relative overhead of classes.
203 - if (
204 - typeof fn.shouldComponentUpdate === 'function' &&
205 - !fn.shouldComponentUpdate(memoizedProps, nextProps)
206 - ) {
207 - // Memoize props even if shouldComponentUpdate returns false
208 - memoizeProps(workInProgress, nextProps);
209 - return bailoutOnAlreadyFinishedWork(current, workInProgress);
210 - }
201 + // TODO: consider bringing fn.shouldComponentUpdate() back.
202 + // It used to be here.
203 }
204
205 var unmaskedContext = getUnmaskedContext(workInProgress);