Uncaught Error
React native is crashing instantly when this library is called using below code:
import RazorpayCheckout from "react-native-razorpay";
and instantly resolves when removed
Package.json
{
"name": "alfamodo-ai",
"version": "1.0.0",
"main": "expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web"
},
"dependencies": {
"@babel/plugin-transform-object-rest-spread": "^7.24.7",
"@expo/config": "~9.0.0",
"@expo/metro-config": "~0.18.1",
"@expo/metro-runtime": "~3.2.1",
"@freakycoder/react-native-bounceable": "^0.2.5",
"@react-native-async-storage/async-storage": "1.23.1",
"@react-native-community/datetimepicker": "8.0.1",
"@react-native-community/slider": "^4.5.2",
"@react-native-picker/picker": "2.7.5",
"@react-navigation/bottom-tabs": "^6.5.20",
"@react-navigation/native": "^6.1.17",
"@react-navigation/native-stack": "^6.9.26",
"@react-navigation/stack": "^6.4.0",
"@types/react": "~18.2.79",
"axios": "^1.7.2",
"babel-plugin-module-resolver": "^5.0.2",
"crypto": "^1.0.1",
"expo": "~51.0.17",
"expo-linear-gradient": "^13.0.2",
"expo-router": "^3.5.18",
"expo-status-bar": "~1.12.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.74.3",
"react-native-accordion": "^1.0.1",
"react-native-animated-spinkit": "^1.5.2",
"react-native-bars": "^2.4.3",
"react-native-chart-kit": "^6.12.0",
"react-native-check-box": "^2.1.7",
"react-native-circular-progress": "^1.4.0",
"react-native-collapsible": "^1.6.1",
"react-native-dynamic-search-bar": "^2.0.2",
"react-native-element-dropdown": "^2.12.1",
"react-native-gesture-handler": "~2.16.1",
"react-native-linear-gradient": "^2.8.3",
"react-native-razorpay": "^2.3.0",
"react-native-reanimated": "~3.10.1",
"react-native-safe-area-context": "4.10.5",
"react-native-screens": "3.31.1",
"react-native-vector-icons": "^10.1.0",
"react-native-web": "~0.19.10",
"typescript": "~5.3.3"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"concurrently": "^8.2.2"
},
"private": true
}
App.js
// App.js
import React, { useState, useEffect } from 'react';
import { StyleSheet, View } from 'react-native';
import AsyncStorage from '@react-native-async-storage/async-storage';
import LandingPage from './screens/LandingPageScreen';
import StackNavigator from './navigation/StackNavigator';
import { StatusBar } from 'expo-status-bar';
import { CartProvider } from './utils/CartContext'; // Adjust the path as needed
export default function App() {
return (
<CartProvider>
<View style={styles.container}>
<StackNavigator />
<StatusBar style="auto" />
</View>
</CartProvider>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
});
Kindly check and help me with what components or dependencies are going wrong because this react-native-Razorpay library is not working. I have tried installing a fresh application but still have the same error. I want to know if it’s a global issue from the Razorpay side or if I am missing out on something that leads to this crash.