Repository navigation
[TypeScript] Properties missing in ImageStyle and TextStyle type #52957
Description
Activity
Warning
Could not parse version: We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.76.2.
Warning
Could not parse version: We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.76.2.
This issue is RN version independent
- changed the title
[-]Properties missing in ImageStyle and TextStyle[/-][+][TypeScript] Properties missing in ImageStyle and TextStyle type[/+]on Aug 1, 2025 - addedNeeds: AttentionIssues where the author has responded to feedback.Issues where the author has responded to feedback.
on Aug 1, 2025 - addedIssue: Author Provided ReproThis issue can be reproduced in Snack or an attached project.This issue can be reproduced in Snack or an attached project.p: Software MansionPartner: Software MansionPartner: Software Mansion
on Aug 1, 2025 Hi @MatiPl01, thank you for reporting this issue.
@j-piasecki could this be related to the Strict Typescript API migrations?
I believe not - Strict API is opt-in, and without enabling it with
react-native-strict-apiin tsconfig it shouldn't affect the project at all. Also, the snack is based on Expo SDK 53, which is based on React Native 0.79, while the TS Strict API was introduced in 0.80.Reacted by Miguel DaipréI had these type issues without
react-native-strict-apienabled. After enablingreact-native-strict-api, types seem to be correct and TS no longer complains, at least not about these 4 properties that I included in the expo snack.I believe not - Strict API is opt-in, and without enabling it with react-native-strict-api in tsconfig it shouldn't affect the project at all.
Yeah, I din't use the new
react-native-strict-api.Also, the snack is based on Expo SDK 53, which is based on React Native 0.79, while the TS Strict API was introduced in 0.80.
I added a snack without looking at the RN version in the snack itself but I tested types in our example app that uses RN 0.80.
Reacted by Miguel Daiprécc @huntie could you look into this one?
Reacted by Miguel Daipré and Mateusz ŁopacińskiHey all 👋🏻 Yeah looks like a bug in these type definitions.
Bug in manual types
Specifically here, where these style props are only defined on
ViewStyle, but not (for instance) the baseFlexStyletype that might be shared with<Text>and<Image>.By contrast, in Flow these are part of the common
____ViewStyle_InternalBase.Fixed with Strict API
This also means that under the
react-native-strict-apiopt-in (i.e. types generated directly from Flow), you should expect not to see this bug :)
cc @jorge-cab @lunaleaps — Could someone look at aligning
StyleSheetTypes.d.tswith what we expect the native components to implement? (could be fiddly) 🙏🏻Reacted by Mateusz Łopaciński, Miguel Daipré and Tomasz ZawadzkiI'll take a look!
Reacted by Miguel Daipré and Mateusz ŁopacińskiA fix is up in #58907: the legacy
ImageStyletype now extendsViewStyle, sofilter,boxShadow,mixBlendMode,borderTopStartRadius,outlineColorand the otherViewStyleprops are accepted on<Image>styles. LegacyTextStylealready inherits these fromViewStyle, and the opt-in Strict TypeScript API never had the gap.- added a commit that references this issue
on Oct 7, 2026
Description
While adding a
filterproperty example in Reanimated example app, we noticed that thefilterproperty doesn't exist in theImageStyletype, whilst this property is most commonly used with image components. Thefilterprop is specified only in theViewStyletype.The same issue applies to other properties like:
boxShadow(which works forImageandTextcomponents but is specified only for theViewcomponent),mixBlendModespecified in theViewStylebut working with theImagecomponent,borderTopStartRadius,outlineColorand likely more other properties which are listed only under theViewStyletype.Steps to reproduce
Just create the
Image(orText) component and pass one of mentioned properties in the style object to see the TypeScript error.React Native Version
0.80.0
Affected Platforms
Build - Linux, Build - Windows, Build - MacOS, Runtime - Desktop, Runtime - Web, Runtime - iOS, Runtime - Android
Output of
npx @react-native-community/cli infoStacktrace or Logs
MANDATORY Reproducer
https://snack.expo.dev/@matipl01/missing-style-prop-types
Screenshots and Videos
View
Image