Fix typo and missing space in AnimatedInterpolation error messages (#56378)

Summary:
Fix two error message issues in `AnimatedInterpolation.js`:

1. **Typo**: "Cannot interpolation an input which is not a number" - should be "Cannot interpolate"
2. **Missing space**: Range validation message was missing a space between the variable name and "cannot", producing malformed output like `outputRangecannot be ]-infinity;+infinity[`

## Changelog:

[GENERAL] [FIXED] - Fix typo "interpolation" to "interpolate" and add missing space in AnimatedInterpolation error messages

Pull Request resolved: https://github.com/facebook/react-native/pull/56378

Test Plan:
1. Trigger the interpolation input validation by passing a non-number input to an interpolation config - verify the error message reads "Cannot interpolate an input which is not a number"
2. Trigger the range validation by passing an infinite range - verify the error message has proper spacing between the parameter name and "cannot"

Reviewed By: zeyap

Differential Revision: D100328205

Pulled By: javache

fbshipit-source-id: ae2eba5404dd7b16bf430c26bc161a83821fa920
This commit is contained in:
Nedunchezhiyan-M authored and meta-codesync[bot] committed 2026-04-13 04:20:47 -07:00
1 parent 64d4d7c131
commit a8b39a237c
1 file changed
+2 -2
@@ -73,7 +73,7 @@ function createNumericInterpolation(
return input => {
invariant(
typeof input === 'number',
'Cannot interpolation an input which is not a number',
'Cannot interpolate an input which is not a number',
);
const range = findRange(input, inputRange);
@@ -345,7 +345,7 @@ function checkInfiniteRange<
* etc. If you really mean this implicit string conversion, you can do
* something like String(myThing) */
// $FlowFixMe[unsafe-addition]
name + 'cannot be ]-infinity;+infinity[ ' + arr,
name + ' cannot be ]-infinity;+infinity[ ' + arr,
);
}