Giter VIP home page Giter VIP logo

Comments (13)

sibelius avatar sibelius commented on August 15, 2024 2

this would simplify a lot the code for sure

from react-native-calendars.

tautvilas avatar tautvilas commented on August 15, 2024 2

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.

tautvilas avatar tautvilas commented on August 15, 2024 1

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.

tautvilas avatar tautvilas commented on August 15, 2024

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.

sibelius avatar sibelius commented on August 15, 2024

I'll try to do this refactor, based on https://hackernoon.com/react-native-new-flatlist-component-30db558c7a5b

from react-native-calendars.

tautvilas avatar tautvilas commented on August 15, 2024

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.

sibelius avatar sibelius commented on August 15, 2024

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.

tautvilas avatar tautvilas commented on August 15, 2024

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.

shawngustaw avatar shawngustaw commented on August 15, 2024

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:

https://github.com/facebook/react-native/blob/a3457486e39dc752799b1103ebe606224a8e8d32/Libraries/Experimental/FlatList.js#L152

from react-native-calendars.

jkomyno avatar jkomyno commented on August 15, 2024

So @sibelius, are you currently working to propose this pull request with FlatList instead of ListView?

from react-native-calendars.

sibelius avatar sibelius commented on August 15, 2024

Not yet, feel free to send a PR

from react-native-calendars.

tautvilas avatar tautvilas commented on August 15, 2024

@jkomyno you worked only on agenda flat-list right? because I am working on converting calendard-list in the branch

from react-native-calendars.

tautvilas avatar tautvilas commented on August 15, 2024

Reservation list has been converted to flat list in 1.6.1. This concludes the FlatList effort :)

from react-native-calendars.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.