Skip to content

Commit e1cd027

Browse files
cortinicotboba
authored andcommitted
fix(Android): change context while running runOnUiQueueThread on 0.73 with Bridgeless (software-mansion#2022)
## Description I've been discussing this change with @WoLewicki. The problem here is that you're attempting to call `runOnUiQueueThread` on the wrong Context. ## Changes Changes the `Context` where we invoke `.runOnUiQueueThread` ## Test code and steps to reproduce Tested against this reproducer: https://github.com/cortinico/reproducer-rnscreens-bridgeless ## Checklist - [x] Included code example that can be used to test this change - [x] Ensured that CI passes Co-authored-by: tboba <[email protected]>
1 parent b26631a commit e1cd027

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

android/src/main/java/com/swmansion/rnscreens/ScreenContainer.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ open class ScreenContainer(context: Context?) : ViewGroup(context) {
318318
// The exception to this rule is `updateImmediately` which is triggered by actions
319319
// not connected to React view hierarchy changes, but rather internal events
320320
needsUpdate = true
321-
(context as? ReactContext)?.runOnUiQueueThread {
321+
(context.applicationContext as? ReactContext)?.runOnUiQueueThread {
322322
// We schedule the update here because LayoutAnimations of `react-native-reanimated`
323323
// sometimes attach/detach screens after the layout block of `ScreensShadowNode` has
324324
// already run, and we want to update the container then too. In the other cases,

0 commit comments

Comments
 (0)