import React, { useEffect, useState } from 'react'; import { SafeAreaView, View, Text, StyleSheet, FlatList } from 'react-native'; import calApi from './db/calendarInfo.api'; const DetailItem = ({ item }) => { return ( <> {item.category} {item.contents} {item.price}원 ); }; const DetailInfo = ({ route }) => { console.log('route', route.params) console.log('---------------------------') const [resData, setResData] = useState([]) const getDetailData = async () => { try { const resdata = await calApi.detailData({ findDate: route.params }) console.log('resdata', resdata) setResData(resdata) } catch (error) { console.log('error in getDetailData', error) } } const renderDetail = ({ item }) => { return ( ) } useEffect(() => { getDetailData() }, []) return ( <> { resData.length != 0 ? item.id} /> : 내역이 없습니다. } ) } const style = StyleSheet.create({ Font: { fontSize: 20, color: '#424242' }, inputColor: { color: '#1E90FF' }, outputColor: { color: '#dc143c' }, itemTextNum: { flex: 1, textAlign: "center", fontFamily: 'GowunDodum-Regular' }, itemText: { flex: 1, fontFamily: 'GowunDodum-Regular' } }); export default DetailInfo;