{"record":{"id":"ce7500ff101ea4a2","repo":"necolas/react-native-web","slug":"scrollresponderscrollto-x-y-animated-is-depre","errorCode":null,"errorMessage":"`scrollResponderScrollTo(x, y, animated)` is deprecated. Use `scrollResponderScrollTo({x: 5, y: 5, animated: true})` instead.","messagePattern":"`scrollResponderScrollTo\\(x, y, animated\\)` is deprecated\\. Use `scrollResponderScrollTo\\((.+?)\\)` instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/react-native-web/src/exports/ScrollView/index.js","lineNumber":302,"sourceCode":"\n  /**\n   * A helper function to scroll to a specific point in the scrollview.\n   * This is currently used to help focus on child textviews, but can also\n   * be used to quickly scroll to any element we want to focus. Syntax:\n   *\n   * scrollResponderScrollTo(options: {x: number = 0; y: number = 0; animated: boolean = true})\n   *\n   * Note: The weird argument signature is due to the fact that, for historical reasons,\n   * the function also accepts separate arguments as as alternative to the options object.\n   * This is deprecated due to ambiguity (y before x), and SHOULD NOT BE USED.\n   */\n  scrollResponderScrollTo = (\n    x?: number | { x?: number, y?: number, animated?: boolean },\n    y?: number,\n    animated?: boolean\n  ) => {\n    if (typeof x === 'number') {\n      console.warn(\n        '`scrollResponderScrollTo(x, y, animated)` is deprecated. Use `scrollResponderScrollTo({x: 5, y: 5, animated: true})` instead.'\n      );\n    } else {\n      ({ x, y, animated } = x || emptyObject);\n    }\n    const node = this.getScrollableNode();\n    const left = x || 0;\n    const top = y || 0;\n    if (node != null) {\n      if (typeof node.scroll === 'function') {\n        node.scroll({ top, left, behavior: !animated ? 'auto' : 'smooth' });\n      } else {\n        node.scrollLeft = left;\n        node.scrollTop = top;\n      }\n    }\n  };\n","sourceCodeStart":284,"sourceCodeEnd":320,"githubUrl":"https://github.com/necolas/react-native-web/blob/a9de220ba9e65bdea540fb5322ffb1da2b0bf442/packages/react-native-web/src/exports/ScrollView/index.js#L284-L320","documentation":"scrollResponderScrollTo historically accepted positional (x, y, animated) arguments; the modern signature takes a single object {x, y, animated}. Passing a number as the first argument triggers a deprecation console.warn telling you to switch to the object form. The old call still works, but is deprecated.","triggerScenarios":"Calling scrollResponderScrollTo(0, 500, true) with positional numeric arguments.","commonSituations":"Older RN codebases migrated to web; following deprecated RN ScrollView docs; codemods not applied.","solutions":["Change the call to the object form: scrollTo({ x, y, animated }).","Update RN-deprecated positional call sites via codemod or search-and-replace.","Silence only if intentional — but prefer migrating since the positional form may be removed."],"exampleFix":"// before\nref.scrollResponderScrollTo(0, 500, true);\n// after\nref.scrollResponderScrollTo({ x: 0, y: 500, animated: true });","handlingStrategy":"validation","validationCode":"function safeScrollTo(ref, opts) {\n  if (typeof opts === 'number') throw new TypeError('Use scrollTo({x, y, animated}), not positional args');\n  ref.scrollResponderScrollTo(opts);\n}","typeGuard":"const isScrollToOptions = (a) => a != null && typeof a === 'object' && !Array.isArray(a);","tryCatchPattern":"// Deprecation uses console.warn; hook it in dev to fail fast:\nconst origWarn = console.warn;\nconsole.warn = (...a) => { if (/scrollResponderScrollTo.*deprecated/.test(a[0])) throw new Error(a[0]); origWarn(...a); };","preventionTips":["Always call scrollTo with an options object","Search for scrollTo( numeric call sites during RN->web upgrades","Enable the RN deprecation codemods when upgrading"],"tags":["react-native-web","scrollview","deprecation","api-change"],"backgroundTag":"deprecated-positional-argument","analyzedSha":"a9de220ba9e65bdea540fb5322ffb1da2b0bf442","analyzedAt":"2026-09-01T10:01:09.883Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}