react-native-radial-gradient
react-native-radial-gradient copied to clipboard
Center should be passed as {x: 0, y: 0} otherwise it won't update
On iOS, if you pass center as [0, 0] and dynamically update it to other value, it won't be updated. As on native side, it is recognised as CGPoint (not NSArray) thus React will not trigger setter for this property if it is not x,y;
Facing the same issue
@oguzhnatly You can use our fork
@oguzhnatly Sorry, we did not make a PR nor fork for this. However in the code you can simply make an HOC with
const convertedCenter = useMemo(() => {
return !center || Platform.OS !== 'ios' ? center : { x: center[0], y: center[1] };
}, [center]);
Thanks @bimusiek!
I've tried passing it as {x: 0, y: 0} yet I get "Property is not configurable" error. However, passing it as an array also has no effect at all no matter what numbers I pass. Is it completely broken or am I missing something obvious here?
(iOS 16.2, RN 0.71.4)