Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(TypeScript): Allow readonly arrays in transform (#46310)
Summary: Currently readonly arrays aren't allowed in components' style, but readonly objects are accepted. This becomes evident in such case: ```ts import { View } from 'react-native'; interface AppProps { transform: readonly ({ translateX: number } | { translateY: number })[]; shadowOffset: Readonly<{ width: number; height: number }>; } export default function App({ transform, shadowOffset }: AppProps) { return ( <> {/* TypeScript error with transform */} <View style={{ transform }} /> {/* No errors with shadowOffset */} <View style={{ shadowOffset }} /> </> ); } ``` ## Changelog: [GENERAL] [FIXED] - Allow readonly array type for transform property Pull Request resolved: #46310 Test Plan: `yarn test-typescript` I added relevant tests cases. Reviewed By: robhogan Differential Revision: D62140462 Pulled By: NickGerleman fbshipit-source-id: 87374b0901ebc40cab48d442b61fe7a65711bc89
- Loading branch information