@samitouri / QOS-React-2 / commits / cf4255445e

Remove unused enqueueSetProps methods

Ben Alpert committed Feb 21, 2016 at 14:30 UTC cf4255445e7c1f0ce3061fbd2466d5da0877d714
2 files changed -106
src/isomorphic/classic/element/ReactElement.js
-19
@@ -249,25 +249,6 @@ ReactElement.cloneAndReplaceKey = function(oldElement, newKey) {
249 return newElement;
250 };
251
252 -ReactElement.cloneAndReplaceProps = function(oldElement, newProps) {
253 - var newElement = ReactElement(
254 - oldElement.type,
255 - oldElement.key,
256 - oldElement.ref,
257 - oldElement._self,
258 - oldElement._source,
259 - oldElement._owner,
260 - newProps
261 - );
262 -
263 - if (__DEV__) {
264 - // If the key on the original is valid, then the clone is valid
265 - newElement._store.validated = oldElement._store.validated;
266 - }
267 -
268 - return newElement;
269 -};
270 -
252 ReactElement.cloneElement = function(element, config, children) {
253 var propName;
254
src/renderers/shared/reconciler/ReactUpdateQueue.js
-87
@@ -12,11 +12,9 @@
12 'use strict';
13
14 var ReactCurrentOwner = require('ReactCurrentOwner');
15 -var ReactElement = require('ReactElement');
15 var ReactInstanceMap = require('ReactInstanceMap');
16 var ReactUpdates = require('ReactUpdates');
17
19 -var assign = require('Object.assign');
18 var invariant = require('invariant');
19 var warning = require('warning');
20
@@ -239,91 +237,6 @@ var ReactUpdateQueue = {
237 enqueueUpdate(internalInstance);
238 },
239
242 - /**
243 - * Sets a subset of the props.
244 - *
245 - * @param {ReactClass} publicInstance The instance that should rerender.
246 - * @param {object} partialProps Subset of the next props.
247 - * @internal
248 - */
249 - enqueueSetProps: function(publicInstance, partialProps) {
250 - var internalInstance = getInternalInstanceReadyForUpdate(
251 - publicInstance,
252 - 'setProps'
253 - );
254 - if (!internalInstance) {
255 - return;
256 - }
257 - ReactUpdateQueue.enqueueSetPropsInternal(internalInstance, partialProps);
258 - },
259 -
260 - enqueueSetPropsInternal: function(internalInstance, partialProps) {
261 - var topLevelWrapper = internalInstance._topLevelWrapper;
262 - invariant(
263 - topLevelWrapper,
264 - 'setProps(...): You called `setProps` on a ' +
265 - 'component with a parent. This is an anti-pattern since props will ' +
266 - 'get reactively updated when rendered. Instead, change the owner\'s ' +
267 - '`render` method to pass the correct value as props to the component ' +
268 - 'where it is created.'
269 - );
270 -
271 - // Merge with the pending element if it exists, otherwise with existing
272 - // element props.
273 - var wrapElement = topLevelWrapper._pendingElement ||
274 - topLevelWrapper._currentElement;
275 - var element = wrapElement.props;
276 - var props = assign({}, element.props, partialProps);
277 - topLevelWrapper._pendingElement = ReactElement.cloneAndReplaceProps(
278 - wrapElement,
279 - ReactElement.cloneAndReplaceProps(element, props)
280 - );
281 -
282 - enqueueUpdate(topLevelWrapper);
283 - },
284 -
285 - /**
286 - * Replaces all of the props.
287 - *
288 - * @param {ReactClass} publicInstance The instance that should rerender.
289 - * @param {object} props New props.
290 - * @internal
291 - */
292 - enqueueReplaceProps: function(publicInstance, props) {
293 - var internalInstance = getInternalInstanceReadyForUpdate(
294 - publicInstance,
295 - 'replaceProps'
296 - );
297 - if (!internalInstance) {
298 - return;
299 - }
300 - ReactUpdateQueue.enqueueReplacePropsInternal(internalInstance, props);
301 - },
302 -
303 - enqueueReplacePropsInternal: function(internalInstance, props) {
304 - var topLevelWrapper = internalInstance._topLevelWrapper;
305 - invariant(
306 - topLevelWrapper,
307 - 'replaceProps(...): You called `replaceProps` on a ' +
308 - 'component with a parent. This is an anti-pattern since props will ' +
309 - 'get reactively updated when rendered. Instead, change the owner\'s ' +
310 - '`render` method to pass the correct value as props to the component ' +
311 - 'where it is created.'
312 - );
313 -
314 - // Merge with the pending element if it exists, otherwise with existing
315 - // element props.
316 - var wrapElement = topLevelWrapper._pendingElement ||
317 - topLevelWrapper._currentElement;
318 - var element = wrapElement.props;
319 - topLevelWrapper._pendingElement = ReactElement.cloneAndReplaceProps(
320 - wrapElement,
321 - ReactElement.cloneAndReplaceProps(element, props)
322 - );
323 -
324 - enqueueUpdate(topLevelWrapper);
325 - },
326 -
240 enqueueElementInternal: function(internalInstance, newElement) {
241 internalInstance._pendingElement = newElement;
242 enqueueUpdate(internalInstance);