> Task :compileReleaseKotlin FAILED
e: file:///Users/kirylziusko/IdeaProjects/react-native-keyboard-controller/android/src/main/java/com/reactnativekeyboardcontroller/extensions/ThemedReactContext.kt:28:51 Type mismatch: inferred type is ThemedReactContext? but ReactContext was expected
💡 Motivation and Context
Before we passed ThemedReactContext directly to UIManagerHelper.getEventDispatcherForReactTag method. It actually works, because ThemedReactContext extends ReactContext and kotlin could cast types automatically.
But it looks like in RN 0.75 something has changed and CI jobs such as gradlew lint and gradlew build (which consumes latest artifacts from maven) started to fail. I've tried to cast it to ReactContext using as ReactContext construction (which is safe, because I'm not using ! or ? symbols) and it started to work again.
So I think we'll go with this fix 👀
📢 Changelog
Android
pass ReactContext instead of ThemedReactContext to UIManagerHelper.getEventDispatcherForReactTag;
🤔 How Has This Been Tested?
Tested on CI.
📸 Screenshots (if appropriate):
📝 Checklist
[x] CI successfully passed
[x] I added new mocks and corresponding unit-tests if library API was changed
📜 Description
Fixed compilation error:
💡 Motivation and Context
Before we passed
ThemedReactContext
directly toUIManagerHelper.getEventDispatcherForReactTag
method. It actually works, becauseThemedReactContext extends ReactContext
and kotlin could cast types automatically.But it looks like in RN 0.75 something has changed and CI jobs such as
gradlew lint
andgradlew build
(which consumes latest artifacts from maven) started to fail. I've tried to cast it toReactContext
usingas ReactContext
construction (which is safe, because I'm not using!
or?
symbols) and it started to work again.So I think we'll go with this fix 👀
📢 Changelog
Android
ReactContext
instead ofThemedReactContext
toUIManagerHelper.getEventDispatcherForReactTag
;🤔 How Has This Been Tested?
Tested on CI.
📸 Screenshots (if appropriate):
📝 Checklist