kirillzyusko / react-native-keyboard-controller

Keyboard manager which works in identical way on both iOS and Android
https://kirillzyusko.github.io/react-native-keyboard-controller/
MIT License
1.62k stars 67 forks source link

fix: don't throw compilation errors for `emitEvent` function for RN < 0.72 #475

Closed kirillzyusko closed 3 months ago

kirillzyusko commented 3 months ago

📜 Description

Fixed compilation errors on RN 0.71 and keyboard-controller 1.12.

💡 Motivation and Context

emitDeviceEvent is available only in RN 0.72 and we don't want to support RN 0.72 as the minimal version (because it's still quite new):

image

The original change was introduced in https://github.com/kirillzyusko/react-native-keyboard-controller/pull/410 - it was needed because old implementation threw errors (crashes) in bridgeless mode on Fabric.

In this Pr I made it compatible with bridgeless + it doesn't use newly introduced methods, so it should have a support until RN 0.65 again.

📢 Changelog

Android

🤔 How Has This Been Tested?

Tested on Pixel 7 Pro (Android 14), Fabric + RN 0.74

📝 Checklist

github-actions[bot] commented 3 months ago

📊 Package size report

Current size Target Size Difference
144061 bytes 144018 bytes 43 bytes 📈