Skip to content

Commit cf1378e

Browse files
committed
[TurboModule] Let's try to use this TurboModule
1 parent a80cea1 commit cf1378e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎App.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import React from 'react';
1010
import type {Node} from 'react';
11+
import NativeAnswerSolver from './js/NativeAnswerSolver';
1112
import {
1213
SafeAreaView,
1314
ScrollView,
@@ -25,6 +26,7 @@ import {
2526
LearnMoreLinks,
2627
ReloadInstructions,
2728
} from 'react-native/Libraries/NewAppScreen';
29+
import Button from "react-native/Libraries/Components/Button";
2830

2931
const Section = ({children, title}): Node => {
3032
const isDarkMode = useColorScheme() === 'dark';
@@ -59,9 +61,15 @@ const App: () => Node = () => {
5961
backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
6062
};
6163

64+
const onPress = () => {
65+
const theAnswer = NativeAnswerSolver?.answerTheUltimateQuestion("What's the Answer to the Ultimate Question of Life, the Universe, and Everything") || ""
66+
console.log('The answer is: ' + theAnswer);
67+
};
68+
6269
return (
6370
<SafeAreaView style={backgroundStyle}>
6471
<StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} />
72+
<Button title="Click to invoke your Turbo Module!" onPress={onPress} />
6573
<ScrollView
6674
contentInsetAdjustmentBehavior="automatic"
6775
style={backgroundStyle}>

0 commit comments

Comments
 (0)