Skip to content

Commit

Permalink
Add native view config for inset props
Browse files Browse the repository at this point in the history
Summary:
The insets props were introduced in this diff: D42193661

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D56849870
  • Loading branch information
RSNara authored and facebook-github-bot committed May 2, 2024
1 parent b4a8a27 commit 20444dc
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
49 changes: 49 additions & 0 deletions packages/react-native/React/Views/RCTViewManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,55 @@ - (void)updateAccessibilityTraitsForRole:(RCTView *)view withDefaultView:(RCTVie
RCT_EXPORT_SHADOW_PROPERTY(borderEndWidth, float)
RCT_EXPORT_SHADOW_PROPERTY(borderWidth, float)

RCT_CUSTOM_SHADOW_PROPERTY(inset, YGValue, RCTView)
{
// Property is only to be used in the new renderer.
// It is necessary to add it here, otherwise it gets
// filtered by view configs.
}

RCT_CUSTOM_SHADOW_PROPERTY(insetBlock, YGValue, RCTView)
{
// Property is only to be used in the new renderer.
// It is necessary to add it here, otherwise it gets
// filtered by view configs.
}

RCT_CUSTOM_SHADOW_PROPERTY(insetBlockStart, YGValue, RCTView)
{
// Property is only to be used in the new renderer.
// It is necessary to add it here, otherwise it gets
// filtered by view configs.
}

RCT_CUSTOM_SHADOW_PROPERTY(insetBlockEnd, YGValue, RCTView)
{
// Property is only to be used in the new renderer.
// It is necessary to add it here, otherwise it gets
// filtered by view configs.
}

RCT_CUSTOM_SHADOW_PROPERTY(insetInline, YGValue, RCTView)
{
// Property is only to be used in the new renderer.
// It is necessary to add it here, otherwise it gets
// filtered by view configs.
}

RCT_CUSTOM_SHADOW_PROPERTY(insetInlineStart, YGValue, RCTView)
{
// Property is only to be used in the new renderer.
// It is necessary to add it here, otherwise it gets
// filtered by view configs.
}

RCT_CUSTOM_SHADOW_PROPERTY(insetInlineEnd, YGValue, RCTView)
{
// Property is only to be used in the new renderer.
// It is necessary to add it here, otherwise it gets
// filtered by view configs.
}

RCT_EXPORT_SHADOW_PROPERTY(marginTop, YGValue)
RCT_EXPORT_SHADOW_PROPERTY(marginRight, YGValue)
RCT_EXPORT_SHADOW_PROPERTY(marginBottom, YGValue)
Expand Down
3 changes: 3 additions & 0 deletions packages/react-native/ReactAndroid/api/ReactAndroid.api
Original file line number Diff line number Diff line change
Expand Up @@ -4145,6 +4145,9 @@ public class com/facebook/react/uimanager/LayoutShadowNode : com/facebook/react/
public fun setFlexWrap (Ljava/lang/String;)V
public fun setGap (Lcom/facebook/react/bridge/Dynamic;)V
public fun setHeight (Lcom/facebook/react/bridge/Dynamic;)V
public fun setInset (Lcom/facebook/react/bridge/Dynamic;)V
public fun setInsetBlock (ILcom/facebook/react/bridge/Dynamic;)V
public fun setInsetInline (ILcom/facebook/react/bridge/Dynamic;)V
public fun setJustifyContent (Ljava/lang/String;)V
public fun setLayoutConformance (Ljava/lang/String;)V
public fun setMargins (ILcom/facebook/react/bridge/Dynamic;)V
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,31 @@ public void setDisplay(@Nullable String display) {
}
}

@ReactPropGroup(
names = {
"insetBlock",
"insetBlockEnd",
"insetBlockStart",
})
public void setInsetBlock(int index, Dynamic inset) {
// Do Nothing: Align with static ViewConfigs
}

@ReactPropGroup(
names = {
"insetInline",
"insetInlineEnd",
"insetInlineStart",
})
public void setInsetInline(int index, Dynamic inset) {
// Do Nothing: Align with static ViewConfigs
}

@ReactProp(name = "inset")
public void setInset(Dynamic inset) {
// Do Nothing: Align with static ViewConfigs
}

@ReactPropGroup(
names = {
ViewProps.MARGIN,
Expand Down

0 comments on commit 20444dc

Please sign in to comment.