What's Changed
A patch release: a build fix for React Native 0.88, a crash fix for animated refs, a safety guard for styles read inside worklets, and fixes for Jest mocks and web.
๐ Build and compatibility
- Fixed the iOS and Android build error on React Native 0.88, where
ImageProps::tintColorbecame optional (#1282, closes #1281)
๐ฅ Crashes
- Fixed the
Object is not a functioncrash inpassForwardedRefwhen a ref callback returns a value that isn't a cleanup function, e.g.useAnimatedRef()on a Unistyles component. Forwarded refs are now detached withnullon unmount, like React does (#1283, closes #1207) - Reading
StyleSheetstyles inside a worklet (e.g.useAnimatedStyle(() => ({ ...styles.box }))) now throws a clear error instead of reading another runtime's memory, which could crash the app or return garbage values. Pass styles next to the animated style instead (style={[styles.box, animatedStyle]}), and useuseAnimatedThemeto read the theme in a worklet (#1284, found while investigating #1213)
๐ Web
ListHeaderComponentStyleandListFooterComponentStyleare now applied onFlatList,SectionListandVirtualizedList(#1248 by @Vadko)- Fixed a blank page in browsers without the Screen Orientation API, such as Safari 16.3 and older; orientation falls back to the viewport there (#1219 by @theonetheycallneo, closes #1073)
๐งช Testing
- The Jest mock registry is now stored on
globalThis, so it survivesjest.resetModules()and duplicate package copies (#1240 by @sohammondal, closes #1239)
โค๏ธ Contributors
Thanks to everyone who sent a PR for this release:
And to those whose PRs and reports shaped the fixes:
- @giaBaoJS (#1232), whose ref cleanup fix is the base of #1283
- @janicduplessis, @manish2612, @efstathiosntonas, @emilhaugberg for detailed bug reports
Full Changelog: v3.5.0...v3.5.1