-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to improve performance? #275
Comments
Hi @TheTushar2696, sorry the late reply We are currently trying to improve this (#209), so I don't have a definitive answer right now. I hope we are able to give more suggestions on this soon. For now:
const [events, setEvents] = useState([ ]);
const callAPI = async () => {
const apiEvents = await callAPI(...);
// I want to see what is done here: map, reduce, etc
const libEvents = apiEvents.map(event => ({ startDate: ..., endDate: ... }))
setEvents(libEvents);
}
|
@pdpino I have created a reducer function instead of using useState() to fetch events, Inside that getFormattedTasksForWeekView() I am using a for loop |
This is what I'm understanding: each time the app queries the API (e.g. after scrolling and reaching new dates), the app triggers the action |
@pdpino No, It only processes the new events , since we are updating the store with the new events and those are only passed to the reducer function, |
@TheTushar2696 for now I can comment the following: <Event
event={event}
EventComponent={EventComponent}
containerStyle={eventContainerStyle}
editEventConfig={editEventConfig}
dragEventConfig={dragEventConfig} // you are not using it yet
/>
|
@pdpino If yes, is there any workaround for the same |
hi @pdpino Any thoughts on the above |
I'm trying to improve performance on our end, alongside fixing the bug in #259 In your CustomEventComponent: I wonder if the Can you show the full code where the variable |
Hi @pdpino Actually Ive noticed if we are not giving any customEventComponent or DayComponent the sluggish behaviour reduces to some extent Sharing code for updating events: I fire an action to setEvents(also gets called when component is mounted), this action when triggered calls getFormattedTasksForWeekView()
|
I'm also thinking that having different logic inside a custom event component could be an issue. Could you measure how faster it is with the default event? |
@hoangnm Not too smooth but a bit better that this logic that I have |
@TheTushar2696 sorry not yet. I'm working on performance at the same time I debug #259, I expect to have updates soon |
Why can't I customize the width of the columns? When I use the timetable, only 6 days appear because the last day gets cut off. @hoangnm |
Hi @pdpino @hoangnm
I am using this library, the overall features looks damm good and I also appreciate how we are continuously trying to make it better, I have a question, How to improve the performance in my app, Just listing down the things I am doing for the week view,
Note: Consider that I have a lot of events
-As soon as the week view loads I am formatting the events in the format the library takes input using reducer functions as mentioned in the examples
I feel the app becomes a bit sluggish when I am doing all these stuff
I am passing the above props to the calendar
Currently I am using react-native-week-view 0.22.0
Please suggest me anything that can help to get rid of this
Thanks in advance
The text was updated successfully, but these errors were encountered: