fix: prevent style={{}} from destroying computed styles in non-["style"] targets (#312)
When a component passes an empty style object (e.g., contentContainerStyle={{}})
to a non-["style"] target, mergeDefinedProps copies the empty object over the
computed className styles, destroying them. This is the same class of bug as
style={undefined} (fixed in PR #291) but for empty objects.
The ["style"] target path (Path A) already handles this correctly via
filterCssVariables({}) returning undefined. This fix extends mergeDefinedProps
with an isEmptyPlainObject check to skip empty objects on paths B and C,
matching Path A's behavior.
Common real-world trigger: components with default empty object parameters
({ contentContainerStyle = {} }) or explicit style={{}} props. Y
YevheniiKotyrlo committed
d490d59c6bc98d930aaa7edfac9a404b8de1ccce
Parent: 7622a38
Committed by GitHub <noreply@github.com>
on 4/8/2026, 9:40:48 PM