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 devbydixon opened 1 month ago

devbydixon commented 1 month ago

The SDK seems to error out when running in expo

fsobh commented 1 month 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 1 month ago

Yeah im facing this issue as well with react native expo

fsobh commented 1 month ago

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

fsobh commented 1 month ago

Any update on this ?