Make it work

This commit is contained in:
Abhay Raizada
2024-03-14 22:43:15 +05:30
parent cd7973f49d
commit 3aae1f5c5e
4 changed files with 49 additions and 49 deletions

25
App.tsx
View File

@@ -5,12 +5,13 @@
* @format
*/
import React, {useEffect, useState} from 'react';
import {SafeAreaView, ScrollView, StatusBar, StyleSheet} from 'react-native';
import React, { useEffect, useState } from 'react';
import { SafeAreaView, ScrollView, StatusBar, StyleSheet } from 'react-native';
import {getFormTemplate} from './formstr/formstr';
import {Colors} from 'react-native/Libraries/NewAppScreen';
import {PrescriptionCreator} from './components/PrescriptionCreator';
import { getFormTemplate } from './formstr/formstr';
import { Colors } from 'react-native/Libraries/NewAppScreen';
import { PrescriptionCreator } from './components/PrescriptionCreator';
import 'react-native-url-polyfill/auto';
function App(): React.JSX.Element {
const backgroundStyle = {
@@ -22,14 +23,16 @@ function App(): React.JSX.Element {
useEffect(() => {
console.log('inside useeffect');
const fetchForm = async () => {
console.log('fetchiiiing forrmmm!!!');
let form = await getFormTemplate(
'eb3df1f89653475f0bcbd22da35f8d2f126db8a68a88a7abedc53535c76c39b4',
);
setForm(form);
if (!form) {
console.log('fetchiiiing forrmmm!!!');
let form = await getFormTemplate(
'eb3df1f89653475f0bcbd22da35f8d2f126db8a68a88a7abedc53535c76c39b4',
)
setForm(form);
}
};
fetchForm();
}, [form, setForm]);
}, [form]);
return (
<SafeAreaView style={backgroundStyle}>