-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.jsx
More file actions
executable file
·33 lines (31 loc) · 1009 Bytes
/
App.jsx
File metadata and controls
executable file
·33 lines (31 loc) · 1009 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { StatusBar } from "expo-status-bar";
import { ScrollView, Text, View } from "react-native";
import { initDatabase } from "./utils/database";
import { useEffect } from "react";
import sharedStyles from "./styles/sharedStyles";
import ReadDB from "./components/ReadDB";
import WriteDB from "./components/WriteDB";
import DeleteDB from "./components/DeleteDB";
import UpdateDB from "./components/UpdateDB";
export default function App() {
useEffect(() => {
// Initialize the database when the app starts
initDatabase()
.then(() => {
console.log("Database initialized successfully");
})
.catch((error) => {
console.error("Database initialization failed:", error);
});
}, []);
return (
<ScrollView style={[sharedStyles.container, { marginTop: 40 }]}>
<Text>Open up App.js to start working on your app!</Text>
<WriteDB />
<ReadDB />
<DeleteDB />
<UpdateDB />
<StatusBar style="auto" />
</ScrollView>
);
}