facebook/react · error · Error

334

334

Error message

Accumulated items must not be null or undefined.

What it means

Error "Accumulated items must not be null or undefined." thrown in facebook/react.

Source

Thrown at packages/react-native-renderer/src/legacy-events/accumulateInto.js:30

/**
 * Accumulates items that must not be null or undefined into the first one. This
 * is used to conserve memory by avoiding array allocations, and thus sacrifices
 * API cleanness. Since `current` can be null before being passed in and not
 * null after this function, make sure to assign it back to `current`:
 *
 * `a = accumulateInto(a, b);`
 *
 * This API should be sparingly used. Try `accumulate` for something cleaner.
 *
 * @return {*|array<*>} An accumulation of items.
 */

function accumulateInto<T>(
  current: ?(Array<T> | T),
  next: T | Array<T>,
): T | Array<T> {
  if (next == null) {
    throw new Error('Accumulated items must not be null or undefined.');
  }

  if (current == null) {
    return next;
  }

  // Both are not empty. Warning: Never call x.concat(y) when you are not
  // certain that x is an Array (x could be a string with concat method).
  if (isArray(current)) {
    if (isArray(next)) {
      // $FlowFixMe[incompatible-use] `isArray` does not ensure array is mutable
      // $FlowFixMe[method-unbinding]
      current.push.apply(current, next);
      return current;
    }
    // $FlowFixMe[incompatible-use] `isArray` does not ensure array is mutable
    current.push(next);
    return current;

View on GitHub (pinned to eafeac097b)

When it happens

Trigger: Thrown at packages/react-native-renderer/src/legacy-events/accumulateInto.js:30 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of facebook/react@eafeac097b (2026-08-21). Data as JSON: /api/errors/496ef8e8c387c078. Report an issue: GitHub.