MCPcopy Create free account
hub / github.com/react-native-linear-gradient/react-native-linear-gradient / convertPoint

Function convertPoint

index.android.js:10–22  ·  view source on GitHub ↗
(name, point)

Source from the content-addressed store, hash-verified

8import NativeLinearGradient, { type Props } from './common';
9
10const convertPoint = (name, point) => {
11 if (Array.isArray(point)) {
12 console.warn(
13 `LinearGradient '${name}' property should be an object with fields 'x' and 'y', ` +
14 'Array type is deprecated.'
15 );
16 }
17 // TODO: Update Android native code to receive a {x, y} object, not an array
18 if (point !== null && typeof point === 'object') {
19 return [point.x, point.y];
20 }
21 return point;
22};
23
24/**
25 * Checks if value is a valid number. Otherwise, defaults to defaultValue.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…