feat: Add native module and package for custom functionality
This commit is contained in:
7
App.tsx
7
App.tsx
@@ -5,7 +5,7 @@ import {
|
||||
StyleSheet,
|
||||
Text,
|
||||
TouchableOpacity,
|
||||
Alert,
|
||||
Alert, NativeModules
|
||||
} from 'react-native';
|
||||
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
||||
import { useState, useEffect } from 'react';
|
||||
@@ -14,6 +14,7 @@ import Register from './src/components/Register';
|
||||
import { authAPI } from './src/services/authAPI';
|
||||
import { networkService } from './src/services/networkService';
|
||||
type Screen = 'login' | 'register' | 'home';
|
||||
const { MyNativeModule } = NativeModules;
|
||||
|
||||
function App() {
|
||||
const isDarkMode = useColorScheme() === 'dark';
|
||||
@@ -25,6 +26,10 @@ function App() {
|
||||
// Initialize app
|
||||
useEffect(() => {
|
||||
initializeApp();
|
||||
console.log("MyNativeModule", MyNativeModule);
|
||||
MyNativeModule.greet("John").then((msg: any) => {
|
||||
console.log(msg);
|
||||
});
|
||||
|
||||
// Listen for network changes
|
||||
const unsubscribe = networkService.addListener((networkState) => {
|
||||
|
||||
Reference in New Issue
Block a user