[react native] firebase database를 이용한 메모장 앱 만들기
import { StatusBar } from 'expo-status-bar'; import React, { useState, useRef, useEffect } from 'react'; import {TextInput, SafeAreaView, FlatList, Button, StyleSheet, Text, View } from 'react-native'; import * as firebase from 'firebase'; var firebaseConfig = { apiKey: "--", authDomain: "--", projectId: "--", storageBucket: "--", messagingSenderId: "--", appId: "--" }; if(firebase.apps.length==..
[react native] 메모장 앱 만들기(리스트 타입)
import { StatusBar } from 'expo-status-bar'; import React, { useState } from 'react'; import { SafeAreaView, StyleSheet, Text, TextInput, TouchableOpacity, View, FlatList, Alert } from 'react-native'; export default function App() { const [writeMode, setWriteMode] = useState(false); const [txt, setTxt] = useState(''); const orimemo = [ { id:'1', memo:'안녕하세요.' }, { id:'2', memo:'서기입니다.' }, { id:'..
[react native] 메모(저장 및 불러오기) 앱
import { StatusBar } from 'expo-status-bar'; import React, {useEffect, useState, } from 'react'; import { StyleSheet, Text, View, SafeAreaView, Button, TextInput } from 'react-native'; import AsyncStorage from '@react-native-async-storage/async-storage'; export default function App() { const [txt, setTxt] = useState('안녕하세요.'); useEffect(() => { loadData(); }, []); const saveData = async (value) ..