Describe the bug
We are using the MX Widget on bare React Native project that uses Expo Modules and recently had to update the SDK to the latest version to fix this issue.
The issue linked above got resolved, but now we're getting the following error:
[Mobile] ERROR TypeError: Linking.addEventListener is not a function (it is undefined)
[Mobile]
[Mobile] This error is located at:
[Mobile] in ConnectWidget (created by MXConnectScreen)
[Mobile] in RCTView (created by View)
[Mobile] in View
We haven't installed expo-linking in our project (is not in the yarn.lock either), but Linking = require("expo-linking") still resolves, but it doesn't export the Linking API. The catch block is never reached, causing the error above.
Steps to reproduce
[Steps to reproduce the behavior:]
- Create a bare react-native project and install expo-modules
- Install
@mxenabled/react-native-widget-sdk
- Try to load the widget
- See error
Expected behavior
The widget loads successfully.
Screenshots

Sample code
<ConnectWidget
url={connectUrl}
onEnterCredentials={(metadata) => {
onConnectivityError?.();
}}
onMemberConnected={(metadata) => {
onSuccess();
}}
onCreateMemberError={(metadata) => {
onConnectivityError?.();
}}
onOAuthError={(metadata) => {
onConnectivityError?.();
}}
onOAuthRequested={(metadata) => {
Linking.openURL(metadata.url);
}}
onSubmitMFA={(metadata) => {
onConnectivityError?.();
}}
style={{
minWidth: WIDGET_MIN_WIDTH_PT,
minHeight: '100%',
}}
/>
Device information
- Device: iPhone 16 Pro and Pixel 8
- OS: iOS 18.2 and Android 14
- React Native version: 0.74.6
- MX React Native Widget SDK version: 1.1.4
- Are you using Expo: Yes, through
expo-modules, but I haven't installed expo-linking
Additional context
We were able to solve the issue by removing the following code using patch-package, and using the Linking provided by react-native rather than checking if Expo's it's available.
let Linking;
try {
Linking = require("expo-linking");
}
catch (err) {
Linking = RNLinking;
}
It would be great to check if the package it's installed in more reliable way, perhaps checking that the addEventListener method is available.
Describe the bug
We are using the MX Widget on bare React Native project that uses Expo Modules and recently had to update the SDK to the latest version to fix this issue.
The issue linked above got resolved, but now we're getting the following error:
We haven't installed
expo-linkingin our project (is not in theyarn.lockeither), butLinking = require("expo-linking")still resolves, but it doesn't export theLinkingAPI. The catch block is never reached, causing the error above.Steps to reproduce
[Steps to reproduce the behavior:]
@mxenabled/react-native-widget-sdkExpected behavior
The widget loads successfully.
Screenshots
Sample code
Device information
expo-modules, but I haven't installedexpo-linkingAdditional context
We were able to solve the issue by removing the following code using patch-package, and using the
Linkingprovided byreact-nativerather than checking if Expo's it's available.It would be great to check if the package it's installed in more reliable way, perhaps checking that the
addEventListenermethod is available.