Comments (13)
this would simplify a lot the code for sure
from react-native-calendars.
I'm glad to announce that CalendarList has been migrated to FlatList in v1.6.0. This simplified code considerably. Performance seems similar so far. Now we only need to migrate reservation-list to FlatList. this should be pretty straightforward.
from react-native-calendars.
I did an initial refactor of CalendarList to FlatList. You can check out my progress in this branch:
https://github.com/wix/react-native-calendars/tree/flat-list
Basic functionality works, but it needs some polish. Currently there is an issue that on initial load only 1 month is visible.
Not sure if performance is better, but code now looks cleaner since I refactored CalendarItem to separate component and also don't need anymore the onScroll
hack for android
from react-native-calendars.
Yes, as I understand this would be a worthy refactor (just there was no FlatList when we started the project). What do you think about it? You think refactor would be easy?
from react-native-calendars.
I'll try to do this refactor, based on https://hackernoon.com/react-native-new-flatlist-component-30db558c7a5b
from react-native-calendars.
I see that FlatList does not have rowHasChanged
prop, or am I missing something? I'm afraid that without rowHasChanged
optimizations performance could be affected. What do you think @sibelius ?
from react-native-calendars.
FlatList
docs (https://facebook.github.io/react-native/docs/flatlist.html) uses PureComponent
to handle optimization and avoid wasteful re-render
We can refactor in another branch, and compare both approaches
from react-native-calendars.
Sounds good. Also I did a hack for Android in ListView
implementation because onChangeVisibleRows
did not work on droid. So I implemented visible items change algo in onScroll
. onViewableItemsChanged
of FlatList
is supposedly supported by both platforms so android specific onScroll
implementation will not be needed anymore.:
https://github.com/wix/react-native-calendars/blob/master/src/calendar-list/index.js#L173
https://github.com/wix/react-native-calendars/blob/master/src/calendar-list/index.js#L136
https://react-native.canny.io/feature-requests/p/listview-onchangevisiblerows-android-support
from react-native-calendars.
I was curious about implementing having the agenda scroll infinitely in both directions and I think FlatList might make that a lot easier. I think one of the open PR's attempted to implement this as well so maybe something to look into:
from react-native-calendars.
So @sibelius, are you currently working to propose this pull request with FlatList instead of ListView?
from react-native-calendars.
Not yet, feel free to send a PR
from react-native-calendars.
@jkomyno you worked only on agenda flat-list right? because I am working on converting calendard-list in the branch
from react-native-calendars.
Reservation list has been converted to flat list in 1.6.1. This concludes the FlatList effort :)
from react-native-calendars.
Related Issues (20)
- How to use months values in calendar instead of dates?
- header style cant change in agendalist
- How can I custom week header ?
- Calendar is crashing when I set Portuguese language HOT 1
- Suggestion: Add a prop to pass custom component or use FlatList from react-native-gesture-handler
- Jitter on scroll calendar list due to ListHeader rendering
- Cannot read property 'Calendar' of undefined
- Support for Nativewind v4 HOT 2
- Don't render empty dates HOT 2
- WARN ReactImageView: Image source "null" doesn't exist HOT 1
- CalendarList opens at the beginning of the date when `pagingEnabled` is enabled for Safari only
- " Cannot read property 'data' of undefined" on expandable calendar arrows
- "day" value of Calendar dosn't shown except markingType={"period"} HOT 1
- Agenda: Automatically jump to previous month when its the 1st day of the month. HOT 1
- when i scroll down or up so fast ,then show me blank screen
- Agenda dark theme props? HOT 1
- Agenda initialPosition
- unable to resolve dependency tree when npm install HOT 2
- WeekCalendar - on scroll ended? Trying to do something after the WeekCalendar has been scrolled... HOT 4
- Theming Documentation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-calendars.