Skip to content

Commit

Permalink
[TurboModule] Let's try to use this TurboModule
Browse files Browse the repository at this point in the history
  • Loading branch information
cortinico committed Feb 28, 2022
1 parent a80cea1 commit cf1378e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions App.js
Expand Up @@ -8,6 +8,7 @@

import React from 'react';
import type {Node} from 'react';
import NativeAnswerSolver from './js/NativeAnswerSolver';
import {
SafeAreaView,
ScrollView,
Expand All @@ -25,6 +26,7 @@ import {
LearnMoreLinks,
ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';
import Button from "react-native/Libraries/Components/Button";

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

const onPress = () => {
const theAnswer = NativeAnswerSolver?.answerTheUltimateQuestion("What's the Answer to the Ultimate Question of Life, the Universe, and Everything") || ""
console.log('The answer is: ' + theAnswer);
};

return (
<SafeAreaView style={backgroundStyle}>
<StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} />
<Button title="Click to invoke your Turbo Module!" onPress={onPress} />
<ScrollView
contentInsetAdjustmentBehavior="automatic"
style={backgroundStyle}>
Expand Down

0 comments on commit cf1378e

Please sign in to comment.