[4.6.0] Late animated props such as contentOffset are synced into style
Description
[!NOTE] This issue was authored by AI on behalf of @qq382724935.
_syncStylePropsBackToReact classifies native props using animatedProp.initial.value. A prop absent on the first evaluation is later written into settledStyle instead of settledProps.
Reproduction
const y = useSharedValue(-1);
const animatedProps = useAnimatedProps(() =>
y.value < 0 ? {} : { contentOffset: { x: 0, y: y.value } }
);
// Attach animatedProps to an Animated.ScrollView with scrollable content.
// After mount:
y.value = withTiming(200);Executing the unmodified sync method with initial {} and settled {contentOffset: {x: 0, y: 200}} produces:
{ settledProps: {}, settledStyle: { contentOffset: { x: 0, y: 200 } } }Expected: contentOffset stays a native prop; its first appearance must not turn it into a style.
Environment: Reanimated 4.6.0, Worklets 0.12.1, RN 0.86.3, Fabric; FORCE_REACT_RENDER_FOR_SETTLED_ANIMATIONS enabled. Also confirmed against main 07aa7ab51, lines 146–178.
Verification is method-level with controlled setState, not a new device test. Searched existing issues; #7453 describes a different trigger/version.
Source: software-mansion/react-native-reanimated