react-native-calendars: Agenda not rendering
I’m running: react-native 53.0 and react-native-calendars 1.17.4
Agenda is not being rendered. All I have is a blank screen.
render(){
return(
<Agenda />
);
}
But this works.
render(){
return(
<CalendarList />
);
}
Any idea what am I doing wrong or missing? My app has been npm run eject. Not sure if that matters…
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 18
I final got it working. Need to set a height.
@hszeto i don’t know if that is the problem, but try removing the View tag.
Height is not the problem
You put one Agenda and one CalendarList in your view (two diferent components) in the example in the comment that you say that “it looks weird”.
The Agenta component has a CalendarList inside it.
Let just stay one agenda on your view and remove the height style.
wow. that took me a couple hours. it was the height the whole time. that should be documented perhaps since it is not required to set height for Calendar to work.
I try the Agenda example, and it works.
Agenda example
also facing problem like aganada working but it loading only not does not the render the view of calander but i using react native calander aganda example why that is it my problem my code, can you help please
export default function AgandaCalanders() { const agandaDayList = { “2024-12-20”: [ { name: “Meeting 1”, data: “the list of items that have to be displayed in agenda. If you want to render item as empty date the value of date key has to be an empty array”, }, ], “2024-12-18”: [ { name: “Meeting 2”, data: “lorem ipsum or lipsum as it is sometimes known, is dummy text used in laying out print, graphic or web designs”, height: 80, }, ], “2024-12-19”: [ { name: “Meeting 3”, data: “lorem ipsum or lipsum as it is sometimes known, is dummy text used in laying out print, graphic or web designs”, }, ], “2024-12-17”: [ { name: “Meeting 4”, data: “lorem ipsum or lipsum as it is sometimes known, is dummy text used in laying out print, graphic or web designs”, }, ], }; return ( <Agenda data={agandaDayList} renderItem={(item: any, isFirst: any) => ( <TouchableOpacity style={styles.item}> <Text style={styles.itemText}>{item.name}</Text> <Text style={styles.itemText}>{item.data}</Text> </TouchableOpacity> )} onDayPress={(day: Date) => console.log(“Selected day”, day)} /> ); }