StyleSheet.absoluteFillObject removed in React Native 0.85
React Native 0.85 removed StyleSheet.absoluteFillObject, deprecated since earlier releases. The release notes put it under breaking changes: "The deprecated StyleSheet.absoluteFillObject API has been removed. Use StyleSheet.absoluteFill or define your own absolute positioning styles instead."
Why it is easy to miss. React Native 0.85 has no error or warning for it: the property is simply gone, so it reads as undefined.
- In TypeScript, the build fails:
absoluteFillObjectno longer exists onStyleSheetin the 0.85 type definitions. - In JavaScript, nothing fails.
{ ...StyleSheet.absoluteFillObject, top: 10 }spreadsundefined, which adds nothing, so the style quietly losesposition: 'absolute'and its edges. Overlays, backdrops and full-screen layers stop covering their parent, and it shows up only on screen.
Fix. StyleSheet.absoluteFill is now a plain style object with the same values (position: 'absolute', top, right, bottom and left at 0), so it can be spread the same way. React Native's own type tests made exactly this change.
- overlay: { ...StyleSheet.absoluteFillObject, backgroundColor: 'rgba(0,0,0,0.5)' },
+ overlay: { ...StyleSheet.absoluteFill, backgroundColor: 'rgba(0,0,0,0.5)' },
- <View style={StyleSheet.absoluteFillObject} />
+ <View style={StyleSheet.absoluteFill} />
Search the project for absoluteFillObject, including code that libraries you patched contain. A library that still uses it needs an update.
Check before you upgrade. npx nativekeel upgrade lists every file that uses absoluteFillObject when your app is on React Native 0.84 or earlier, with the other changes between your version and the newest one. In our scan of 1,162 open-source React Native projects, 146 that are still on 0.84 or earlier use it.
npx nativekeel