Skip to content

Commit

Permalink
Expose string types for boxShadow and filter (#45685)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #45685

We built these to be able to parse web style string values, but the types only allow object form, and the TypeScript type is wrong.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D60263730

fbshipit-source-id: 7a6e93924a92e8e62346645cb4f8ab1a37dca34f
  • Loading branch information
NickGerleman authored and pull[bot] committed Nov 21, 2024
1 parent e1f3ed0 commit 111f6b1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/react-native/Libraries/StyleSheet/StyleSheetTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -778,8 +778,8 @@ export type ____ViewStyle_InternalCore = $ReadOnly<{
elevation?: number,
pointerEvents?: 'auto' | 'none' | 'box-none' | 'box-only',
cursor?: CursorValue,
experimental_boxShadow?: $ReadOnlyArray<BoxShadowPrimitive>,
experimental_filter?: $ReadOnlyArray<FilterFunction>,
experimental_boxShadow?: $ReadOnlyArray<BoxShadowPrimitive> | string,
experimental_filter?: $ReadOnlyArray<FilterFunction> | string,
experimental_mixBlendMode?: ____BlendMode_Internal,
}>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8487,8 +8487,8 @@ export type ____ViewStyle_InternalCore = $ReadOnly<{
elevation?: number,
pointerEvents?: \\"auto\\" | \\"none\\" | \\"box-none\\" | \\"box-only\\",
cursor?: CursorValue,
experimental_boxShadow?: $ReadOnlyArray<BoxShadowPrimitive>,
experimental_filter?: $ReadOnlyArray<FilterFunction>,
experimental_boxShadow?: $ReadOnlyArray<BoxShadowPrimitive> | string,
experimental_filter?: $ReadOnlyArray<FilterFunction> | string,
experimental_mixBlendMode?: ____BlendMode_Internal,
}>;
export type ____ViewStyle_Internal = $ReadOnly<{
Expand Down
7 changes: 5 additions & 2 deletions packages/react-native/types/experimental.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,11 @@ declare module '.' {
}

export interface ViewStyle {
experimental_boxShadow?: BoxShadowPrimitive | undefined;
experimental_filter?: ReadonlyArray<FilterFunction> | undefined;
experimental_boxShadow?:
| ReadonlyArray<BoxShadowPrimitive>
| string
| undefined;
experimental_filter?: ReadonlyArray<FilterFunction> | string | undefined;
experimental_mixBlendMode?: BlendMode | undefined;
}
}

0 comments on commit 111f6b1

Please sign in to comment.