leantechnologies / link-sdk-react-native

LinkSDK for React Native
MIT License
5 stars 6 forks source link

Is this SDK compatible with React Native Expo ? #91

Open ghost opened 4 months ago

ghost commented 4 months ago

The SDK seems to error out when running in expo

fsobh commented 4 months ago

Render Error View config getter callback for component RCTModalHostView must be a function (received 'undefined').

Getting this when i run on Android. IOS is just flat out not working. Also using Expo (SDK 51.0)

import React, {useRef} from 'react';
import { View, StyleSheet, Text, Image } from 'react-native';
import { Button, useTheme} from 'react-native-paper';
// @ts-ignore
import LinkSDK from "lean-react-native";

const Screen: React.FC = () => {

  const theme = useTheme();

  const styles = createStyles(theme);
    const Lean = useRef(null)
  return (
      <View style={styles.container}>

          <LinkSDK
              ref={Lean}
              appToken="xxxxxx-6e5e-xxxx-xx58-bx6xd9fxxxxx"
              version="@latest"
              country="ArabEmirates"
              sandbox
          />
          <Button style={styles.button} mode="contained" textColor="#013511"  onPress={() => Lean.current.connect({ customer_id: "xxxxxxx" })}>
              Link Bank Account
          </Button>

      </View>
  );
};

image

kamalm96 commented 4 months ago

Yeah im facing this issue as well with react native expo

fsobh commented 4 months ago

Question opened on stack overflow : https://stackoverflow.com/questions/78744691/render-error-view-config-getter-callback-for-component-rctmodalhostview-must-be

fsobh commented 4 months ago

Any update on this ?

ghost commented 2 months ago

Fixed it. Had to Re-write part of the SDK so its compatible with Expo at least. The issue is with the modal host view when it interacts with the Webview component. Will post solution here shortly.

vkozinec commented 2 months ago

@devbydixon Hey, thx for getting into this. We have same issue, do you mind sharing the solution?