diff --git a/App.js b/App.js index 2e42350d..c33c6035 100644 --- a/App.js +++ b/App.js @@ -6,7 +6,8 @@ * @flow strict-local */ -import React from 'react'; +import * as React from 'react'; +import {useRef, useState} from 'react'; import type {Node} from 'react'; import NativeAnswerSolver from './js/NativeAnswerSolver'; import { @@ -27,6 +28,8 @@ import { ReloadInstructions, } from 'react-native/Libraries/NewAppScreen'; import Button from "react-native/Libraries/Components/Button"; +import AnswerViewer, {Commands as AnswerViewerCommands} from './js/NativeAnswerViewer'; +import type {AnswerViewerViewType} from './js/NativeAnswerViewer'; const Section = ({children, title}): Node => { const isDarkMode = useColorScheme() === 'dark'; @@ -61,15 +64,21 @@ const App: () => Node = () => { backgroundColor: isDarkMode ? Colors.darker : Colors.lighter, }; + const ref = useRef | null>(null); + const [step, setStep] = useState(1); + 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); + setStep(step+1); + AnswerViewerCommands.changeBackgroundColor(ref.current, "red"); }; return (