fix: iOS build on react-native 0.87 (namespaced header imports) - #44
Conversation
React Native 0.87 removed the legacy bridge header search paths, so the quoted imports in LiquidGlassView.mm and LiquidGlassContainerView.mm no longer resolve. RCTImagePrimitivesConversions.h also moved under react/renderer/imagemanager. Switch all three to namespaced imports.
There was a problem hiding this comment.
Pull request overview
Updates iOS native Objective‑C++ sources to build on React Native 0.87+ by switching legacy quoted React header imports to namespaced/module-style imports (and accounting for one header relocation).
Changes:
- Switched
RCTFabricComponentsPlugins.himports to<React/...>in both iOS view implementations. - Switched
RCTConversions.hto<React/...>inLiquidGlassView.mm. - Updated
RCTImagePrimitivesConversions.hinclude to the React Native 0.87+ location underreact/renderer/imagemanager.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| ios/LiquidGlassView.mm | Updates React Native header imports (including the relocated image primitives conversions header). |
| ios/LiquidGlassContainerView.mm | Updates React Native Fabric plugins header import to namespaced form. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The header only moved to react/renderer/imagemanager in react-native 0.87, and the README supports 0.80+. Guard the new path with __has_include and fall back to the old quoted import.
|
when do this pr can be merged? I am at react-native@0.87, and the app keeps crash when i use liquid glass component @eduardoborges |
|
@WynnLin merging is up to the maintainers, but you don't need to wait for it. We've had this change running in our app as a package patch since we moved to 0.87:
#import <react/renderer/imagemanager/RCTImagePrimitivesConversions.h>
#import <React/RCTFabricComponentsPlugins.h>
#import <React/RCTConversions.h>
You can also grab the diff straight from this PR: https://github.com/callstack/liquid-glass/pull/44.diff One heads-up: for us, stock 0.8.0 on react-native 0.87 fails at build time with missing headers. If your app builds fine and only crashes at runtime, you're probably hitting something else and this patch won't help. |
satya164
left a comment
There was a problem hiding this comment.
thanks for the PR. i have one comment. will merge after it's addressed
| #if __has_include(<react/renderer/imagemanager/RCTImagePrimitivesConversions.h>) | ||
| // react-native 0.87+ | ||
| #import <react/renderer/imagemanager/RCTImagePrimitivesConversions.h> | ||
| #else | ||
| #import "RCTImagePrimitivesConversions.h" | ||
| #endif |
There was a problem hiding this comment.
is this actually necessary for older react native versions?
lets remove the conditional unless necessary.
There was a problem hiding this comment.
Good call, it isnt needed. I double checked React-ImageManager.podspec has shipped header_dir "react/renderer/imagemanager" since at least react-native 0.80, so the namespaced import resolves on the whole supported range. What 0.87 removed was only the search paths that made the quoted form work.
…0.80 React-ImageManager.podspec has header_dir react/renderer/imagemanager back to react-native 0.80, so the namespaced import resolves on the whole supported range and the conditional was dead weight.
React Native 0.87 removed the legacy bridge, and with it the header search paths that made quoted imports like
#import "RCTFabricComponentsPlugins.h"resolve. On 0.87 the iOS build fails inLiquidGlassView.mmandLiquidGlassContainerView.mm.This switches the three affected imports to their namespaced form:
"RCTFabricComponentsPlugins.h"→<React/RCTFabricComponentsPlugins.h>(both files)"RCTConversions.h"→<React/RCTConversions.h>"RCTImagePrimitivesConversions.h"→<react/renderer/imagemanager/RCTImagePrimitivesConversions.h>(where the header lives)We've been carrying this change as a pnpm patch on 0.8.0 since upgrading our app to react-native 0.87.0. The build passes and the glass views render as before.
All three namespaced paths resolve on the whole supported range, not just 0.87:
React-ImageManager.podspechas shippedheader_dir "react/renderer/imagemanager"since at least react-native 0.80, so no version guard is needed. What 0.87 removed was only the search paths that made the quoted form work.