Advanced React Native FlatList animations at 60fps with Animated API

Поділитися
Вставка
  • Опубліковано 4 лют 2025

КОМЕНТАРІ • 277

  • @CatalinMironDev
    @CatalinMironDev  4 роки тому +23

    I received a lot of comments that this is not visible on Android devices. Here's the fix for it: snack.expo.io/@catalinmiron/react-native-movie-2.0-carousel-for-android. Thanks a ton!

    • @kylenoome4482
      @kylenoome4482 2 роки тому

      having issues with this can i speak to you on twitter?

    • @Dipenparmar12
      @Dipenparmar12 2 роки тому

      Still not working on Android.

    • @zare775
      @zare775 Рік тому

      Hi, in your example you use useNativeDriver: false. It is too slow on my device. Do you have any solution with useNativeDriver: true for android ?

    • @pixelwizardai
      @pixelwizardai Рік тому

      I have managed to try and works on android, don't know the implication but I make the { useNativeDriver:false} in Animate.Flatlist} and follow the above code link, and made some changes as the input range is const inputRange = [
      (index - 1.5) * ITEM_SIZE,
      (index - 1) * ITEM_SIZE
      ] and const translateX = scrollX.interpolate({
      inputRange,
      outputRange:[0, width],
      extrapolate:'clamp'
      })

    • @shiftcommand
      @shiftcommand Рік тому

      @@pixelwizardai where did you put useNativeDriver false

  • @prakashd842
    @prakashd842 4 роки тому +48

    This guy is very underrated . He deserves more subscribers .

  • @thatsalot3577
    @thatsalot3577 2 роки тому +1

    Ohhhh... I can't express how happy I am like I can do all that stuff in css or framer motion but I was struggling to do that in react native and thought that I lost all my progress but your channel gave me hope to continue working on react native.

  • @sripasum3122
    @sripasum3122 4 роки тому +10

    You deserve many more subscribers for this. Thank you for the quality content ☺️

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому +1

      Thank you Sridatta, I’m doing my best to teach as many things as possible and I’m just scratching the surface here:) ✌️

  • @all-in-all7862
    @all-in-all7862 4 роки тому +5

    Thanku so much bro I will be implementing this animation in my project, I will share your video in my friend circle I think you deserve more subscribers,🙂👍

  • @faisalimtiaz4390
    @faisalimtiaz4390 3 роки тому

    This guy deserve to be the top react native teacher on youtube.

  • @theOrdinaryDev
    @theOrdinaryDev 3 роки тому +1

    This is the best react native content I have ever seen.

  • @jolly7506
    @jolly7506 4 роки тому +2

    Thank you for making awesome tuts for us and inspiring the React Native movement!

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому +1

      Glad you like them and it's my pleasure Erik. I am involved in this community for more than 6 years and I simply love it. Thank you for sharing your thoughts ✌️

  • @joshreynolds4164
    @joshreynolds4164 4 роки тому +7

    You've gotta get an animations course out man! Awesome stuff, thank you!

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому +12

      Thank you Josh! I'm working on it ❤️

    • @joshreynolds4164
      @joshreynolds4164 4 роки тому +1

      @@CatalinMironDev Can't wait!

    • @hansderly
      @hansderly 4 роки тому +1

      @@CatalinMironDev I'm waiting for it dude, awesome work brother

    • @vkray
      @vkray 4 роки тому +1

      Catalin Miron I also suggested you on Twitter regarding the course.

    • @aqeebhj5467
      @aqeebhj5467 4 роки тому

      @Catalin Miron hi can you please make a video on how use graphes in react native and how to show them on mobile it will be helpful for my project thank you for hearing me.

  • @ethantastic
    @ethantastic 3 роки тому

    this man is directly connected

  • @akmalahmed4660
    @akmalahmed4660 4 роки тому +1

    Thank you very much. I'll share this video with my friends.

  • @collocheru
    @collocheru 4 роки тому +1

    Your explanations are really nice, thanks for a great tutorial

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому +1

      Thank you Cheruiyot! I’m always trying to improve myself ✌️

    • @collocheru
      @collocheru 4 роки тому

      @@CatalinMironDev That's great, you are so good, how long have you worked with react native?

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому +1

      @@collocheru Since January 2015 (I had access to the private React Native repository).
      You can listen to my React Native Radio session to find out more about me and my work:
      dev.to/reactnativeradio/rnr-122-react-native-animations-feat-catalin-miron
      dev.to/reactnativeradio/rnr-168-animations-and-micro-interactions-in-react-native-with-catalin-miron
      Thank you Cheruiyot ✌️

  • @tiganaGTV
    @tiganaGTV 4 роки тому

    Thank you very much for your great content. I'm going to watch all your videos. I'm new to react-native.

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому

      Glad you like them and welcome to React Native community Ibrahim! ✌️

  • @koffworld7857
    @koffworld7857 Рік тому

    This interface is out of this world! 🥰🥰

  • @aleks6331
    @aleks6331 4 роки тому +1

    Awesome video, clean code, no complications!

  • @lucasmoura5698
    @lucasmoura5698 2 роки тому

    Hey man, that was a really nice video, and a great learning. Thanks, from Brasil

  • @AkshatKumawat
    @AkshatKumawat 4 роки тому +2

    I'm pretty impressed with this tutorial and your way to teach is so good... Cam you please make a video on instgram stories animation that will be appreciated ❤️

  • @semiherdogan1032
    @semiherdogan1032 2 роки тому

    very helpful tutorial! I learnt a lot about animations on rn through your videos 👍🏻 thank you...

  • @ahmedsamir-m8s
    @ahmedsamir-m8s 2 роки тому

    Finally UA-cam suggested great channel

  • @dannyhw
    @dannyhw 4 роки тому +4

    Great work! By the way you can also add padding to the flatlist contentContainerStyle instead of doing a dummy element.

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому +3

      You are right! I wanted to show both ways dummy elements and padding (this will be in a future tutorial) but stick with padding. Thanks Danny ✌️

  • @codehack3536
    @codehack3536 4 роки тому +1

    You are god of Flat List Animation.

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому +1

      hahaha, thank you ✌️I just wanted to show that it is possible to create awesome stuff with React Native :)

  • @cleversonluizcorreiadesouz5959
    @cleversonluizcorreiadesouz5959 3 роки тому +8

    Man... You definitely should make an Udemy course on ReactNative animation...

  • @adilmezghouti
    @adilmezghouti 3 місяці тому

    Nicely done. Thanks for sharing.

  • @andreistoica1332
    @andreistoica1332 3 роки тому

    Great work! I enjoyed every piece of it.

  • @damyHarbi
    @damyHarbi 3 роки тому

    Bro.. it was amazing..!!! you are PRO

  • @johnnyquid8146
    @johnnyquid8146 3 роки тому

    This was awesome, I loved it, super helpful.

  • @iqorlobanov
    @iqorlobanov 4 роки тому +1

    Best animation tutorials! Thanks! 👍

  • @Lili_4405
    @Lili_4405 3 роки тому

    Thank you from Brazil!

  • @codehack3536
    @codehack3536 4 роки тому

    Awesome video, please continue making video like this.

  • @IAjayMukhiya
    @IAjayMukhiya 18 днів тому

    I like the devs who code in IDE with white background.

    • @CatalinMironDev
      @CatalinMironDev  14 днів тому

      I actually prefer light themes but currently I am using a dark one which is ok as well: Batman Mono

  • @sanjoyrakshit842
    @sanjoyrakshit842 5 місяців тому

    Nice sir it's really useful love from India

  • @sibrimbarcenasreales5525
    @sibrimbarcenasreales5525 7 місяців тому

    Nice video, thanks for this content !

  • @sykn3z
    @sykn3z 4 роки тому +1

    Thanks keep making videos like this! :D

  • @nikhil73nainta
    @nikhil73nainta 4 роки тому +1

    Great work Catalin

  • @anhquannguyen5111
    @anhquannguyen5111 4 роки тому

    Great tutorial again. Thank you so much

  • @totaltotal157
    @totaltotal157 4 роки тому +1

    Just on time! Thanks!

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому

      You’re welcome. Thanks for checking out this video ✌️

  • @zdzboss
    @zdzboss 4 роки тому

    Awesome tutorial. Thank you!

  • @devilstudio2719
    @devilstudio2719 4 роки тому

    Nice tut on react native 🤘. I'm noob to react native . Dude u explain amazingly about all stuff....
    I would suggest to try building from scratch..
    Overall nice tuts dude🤘

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому +1

      Great suggestion! Thanks a lot Sahil it really means a lot to me to be able to help you! Thanks ✌️

  • @youssefmuhamad3213
    @youssefmuhamad3213 4 роки тому

    Awesome! Bring more animation videos, you explain very well. +1 sub

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому +1

      Thank you Youssef! There's more to come ✌️

  • @jeanwona2689
    @jeanwona2689 Рік тому +1

    Hello dear, thank you for all the work you have done. But for fix the flatlist active component in the middle of screen, you can use another smooth way. You can create a Empty component that will contain an empty view which must have SPACER_ITEM_SIZE as width value. Then put this component as listHeaderComponent and listFooterComponent for your flatlist. That is all. Sorry for my bad english guys.
    Please, have you a store of paid react-native advanced animations courses for people who want it?

  • @naibtahmazli6384
    @naibtahmazli6384 4 роки тому

    instead of using if statement to check and add view u can directly add view to before an after flatlist using listHeaderComponent and listFooterComponent

  • @karthikbalasubramanian5122
    @karthikbalasubramanian5122 2 роки тому

    Great tutorial. I am wondering, how can I loop this content, in the Flatlist. Really finding hard on how to get the Flatlist items to loop.
    Thanks a lot. Your videos have helped me understand React Native and Animations better every time. Thanks!!

  • @nicolasmendonca3624
    @nicolasmendonca3624 4 роки тому +1

    That is awesome! Thank you!

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому +1

      You’re welcome Nicolas, I’m glad that you like it✌️

  • @jackwhite5070
    @jackwhite5070 4 роки тому +1

    Perfectly beautiful

  • @ItsViswaa
    @ItsViswaa 3 роки тому

    Man... You're the best!

  • @felixgallo5132
    @felixgallo5132 4 роки тому +3

    if you could do some tutorials for firebase with react native from scratch would be awasome, there are not many of them and the available ones are not so good as well.
    Thanks for your work!

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому +3

      I already have a series where I create a Habits app frok scratch with GraphQL (backend and mobile) but I will definitely consider expanding the content here. Thanks Felix ✌️

    • @felixgallo5132
      @felixgallo5132 4 роки тому

      @@CatalinMironDev Thanks to you Catalin!

  • @borasumer
    @borasumer 4 роки тому

    Awesome job again, thanks man.

  • @iamshadmirza
    @iamshadmirza 4 роки тому

    Very cool. Thank you for this.

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому

      Glad you liked it and you're welcome. Thanks Mohd! ✌️

  • @Abram879
    @Abram879 3 роки тому

    Great tutorial, thanks

  • @gung2267
    @gung2267 4 роки тому +2

    Really really good!!!

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому

      Thank you so much for showing your support ✌️

  • @BearkFearGamer
    @BearkFearGamer 4 роки тому

    We can make this infinity? Like a linked list? The last item is linked to the first and this idea. Well, i think this is better than the spacer in start and the end. The right spacer shows the first items and the left-spacer of the first item show the last. You can do this in another tutorial?

  • @darshanponikar3633
    @darshanponikar3633 4 роки тому

    Man this is awesome!

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому

      Thanks Darshan, I’m glad you liked it ✌️

  • @mohammadkhoirulanam5322
    @mohammadkhoirulanam5322 4 роки тому

    Thanks, this is the best tutorial

  • @sanketpuhan9649
    @sanketpuhan9649 2 роки тому

    hey hi i really loved your teaching .. got a doubt how to pass props to components in shared element Screen ??

  • @everyonevoice
    @everyonevoice 2 роки тому

    This is very good and I just want to know how you imagin before any animation

  • @hritikagarwal7676
    @hritikagarwal7676 4 роки тому

    Thanks Catalin for this amazing content. By the way when you are starting making content on reanimated 2?

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому +1

      Maybe next year, I’m not yet finished with Animated API and most probably you’ll see Reanimated2 content after I’ll publish my Reanimated2 course. Cheers Hritik ✌️

  • @techienomadiso8970
    @techienomadiso8970 4 роки тому

    I hit like before I watch! !

  • @tanvirazad49
    @tanvirazad49 4 роки тому

    earned yourself a subscriber here!

  • @md.rajibsk4613
    @md.rajibsk4613 4 роки тому

    Grt Job Man 👍👍... You got a new subscriber 🤣

  • @julianchamberlain69
    @julianchamberlain69 2 роки тому

    Hi man, great work! Is it possible to add a swipe up and down to the centered item? Would be a great feature! Or if possible could you point me in the right direction on how to do this, thanks

  • @stefanhallgr
    @stefanhallgr 4 роки тому +1

    I like the curly brackets, what theme are you using in VS Code ? or what do you use to get these unique, more readable, brackets ?

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому +1

      Hi, my VSCode theme is Palenight and the font is called Operator Mono. Thanks Stefan ✌️

  • @jackyvegaz
    @jackyvegaz 3 роки тому

    you have my respect bro!

  • @skshahidali2280
    @skshahidali2280 4 роки тому

    Thank you so much man.

  • @samidebayroune3478
    @samidebayroune3478 2 роки тому

    I wonder if I can ever be in where you are in React Native

  • @bharatmishra250
    @bharatmishra250 3 роки тому

    I'm your new subscriber 😁

  • @ahmedayachi5889
    @ahmedayachi5889 3 роки тому

    ty for the video i always watch the anim and try to make it by my own and then watch your solution , about the spacer it would be better if you have added paddingHorizontal to the flatlist container instead of creating a spacer element , ty for your videos again

  • @junangameplays3271
    @junangameplays3271 4 роки тому

    Awesome, could you make a vídeo of shuffling cards and when you choose one, it leaves from the card deck and go to another position

  • @ehsaneshaghi1946
    @ehsaneshaghi1946 2 роки тому

    it's so awesome
    how can I add auto scrolling to this project?

  • @adedayo4405
    @adedayo4405 4 роки тому

    Boooyaaah!! Lets go! Love you man.

  • @kambingitem298
    @kambingitem298 4 роки тому

    awesome 👍 thanks lord

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому

      I’m glad that you like it. Thanks Dio ✌️

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому

      I’m glad that you like it. Thanks Dio ✌️

  • @jassbillu
    @jassbillu 2 роки тому

    please create one video for inshorts kind of animation in react native flatlist

  • @srikanthmukkera3942
    @srikanthmukkera3942 3 роки тому

    will you also make a video to make this a loop of bidirectional carousel?

  • @bymathears6769
    @bymathears6769 4 роки тому

    Good video and thanks for the knowledge you share with us. But I don't get the argument you pass in Animated.event in the onScroll prop. Where can I find documentation for the 'argMapping' in react-native (espacially for animated; confused af)

    • @bymathears6769
      @bymathears6769 4 роки тому

      if anyone is interested, i found this:
      {
      "contentOffset": {
      "x": 0,
      "y": 2395.333333333333
      },
      "layoutMeasurement": {
      "width": 414,
      "height": 736
      },
      "contentSize": {
      "width": 414,
      "height": 5000
      },
      "zoomScale": 1,
      "updatedChildFrames": [],
      "contentInset": {
      "right": 0,
      "top": 0,
      "left": 0,
      "bottom": 0
      }
      }
      animationbook.codedaily.io/scroll

  • @AndreiKashkan
    @AndreiKashkan 4 роки тому +1

    Hey! It is amazing video! Just have a question. How can I get current index of active item?

  • @makakolemafane9933
    @makakolemafane9933 4 роки тому +1

    Please help. How do I get the index of the active slide?

    • @carlosjacobfield-sierra3759
      @carlosjacobfield-sierra3759 4 роки тому

      go to his discord I found a solution to this that I posted under help. However, it makes it run slower so theres a hopefully a better solution out there

    • @carlosjacobfield-sierra3759
      @carlosjacobfield-sierra3759 4 роки тому

      // Pack Index
      const [packIndex,setPackIndex] = React.useState(0)
      const scrollX = React.useRef(new Animated.Value(0)).current
      const Item_Size = new Animated.Value(ITEM_SIZE)
      React.useEffect(() => {
      scrollX.addListener(val => {
      // Divides Scrollx by the size of each item
      const x = Animated.divide(scrollX,Item_Size);
      // Gives index number of each
      const indexNum= Math.round(Number.parseFloat(JSON.stringify(x)));
      setPackIndex(indexNum)
      });
      }, []);

    • @makakolemafane9933
      @makakolemafane9933 4 роки тому

      @@carlosjacobfield-sierra3759 Thank you very much! I will give this a shot

  • @muhammaddanish6956
    @muhammaddanish6956 3 роки тому

    @Catalin Miron how to achieve dynamic scroll able vertical pager ( tabs ) with lazy effect.

  • @di107dev
    @di107dev 3 роки тому

    Very good video!

  • @oguzhanturker8903
    @oguzhanturker8903 4 роки тому

    Awesome vids thanks a lot

  • @siyabongahadebe18
    @siyabongahadebe18 Рік тому

    If I am using a react native reanimated carousel, how can I get the scrollX to work

  • @naturegoggle
    @naturegoggle 4 роки тому

    Awesome. Keep it up.

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому

      Thank you Kuldeep, I’m glad you like the video ✌️

  • @mhasnain.ali_
    @mhasnain.ali_ 4 роки тому

    Great work!!
    Can you help me with the Dynamic Input fields Adding to the array as an object. And showing it on click of plus button, with Animation?
    I'm not getting it write or tell me where to look for it...

  • @informatvetv4843
    @informatvetv4843 Рік тому

    I selected same code of yours but background image is not moving . first one stays even i move to next movie

  • @hbinh6
    @hbinh6 4 роки тому

    Thank u so much bro! But do u have video tutorial full about your project? I'm beginner. Pls

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому

      No, sorry :( I don't have a full working app for this carousel but this is also going to be part of 10 React Native challenges which I am doing now and it's the last video. Here's the Patreon post to see what we are going to build: www.patreon.com/posts/10-types-of-41446571

  • @buthex
    @buthex 4 роки тому

    hello! awesome video
    can you helpe, please?
    I`m also animating opacity of the items to 0.5 when they are not in the center, but whenever I set a state on this screen, it messes with the opacity. I guess it re renders the list and reapply the opacity, so if im a the 3rd item up, they become invisible
    would you know how to fix it?
    thanks!

  • @PlayerHeader
    @PlayerHeader 4 роки тому

    awesome video!!! subscription

  • @islombeknishonboev2208
    @islombeknishonboev2208 3 роки тому

    Good Afternon can you code also in kotlin in this 16:20 Animate Svg to create the parallax effect part

    • @GetPythonCode
      @GetPythonCode 3 роки тому +2

      I'm working on this and we might work together

  • @Viruhemanth
    @Viruhemanth 4 роки тому +4

    Can you make a video on Instagram Bottom Sheet Animation using Reanimated 2?

    • @alexalannunes
      @alexalannunes 4 роки тому +1

      I'd like to see it \o/

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому +1

      I may be dumb but could you please share it with me? I don’t know about what animations you’re talking about. Thanks Hemanth! ✌️

    • @Viruhemanth
      @Viruhemanth 4 роки тому

      @@CatalinMironDev When you try to DM a Post On Instagram a Sheet Pops up from the bottom.

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому +2

      @@Viruhemanth I'll take a look at it and let you know. Thanks for sharing some inspiration with me :)

    • @Viruhemanth
      @Viruhemanth 4 роки тому

      @@CatalinMironDev We should Thank you guys for making these amazing contribution to RN community

  • @brd3n
    @brd3n 8 місяців тому

    Brillant 👍👏

  • @Deviliumrei
    @Deviliumrei 3 роки тому

    How do you stop the carousel so that it won't scroll more than one item per swipe?

  • @davidreyes7732
    @davidreyes7732 4 роки тому

    Great Tutorial,
    I used the fixed version on Android and I wasn't able to run at 60fps I got frames dropped .
    this is due my phone?? or just because animated on android works like that?

  • @kamalsaxena1384
    @kamalsaxena1384 4 роки тому

    How to integrate payment gateway and generate invoice bill after payment

  • @666thales666
    @666thales666 4 роки тому +1

    Awesome! iOS works fine, but,
    why is the backdrop component so slow on android?

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому

      I fix it since it was reported yesterday, here's the updated link: snack.expo.io/@catalinmiron/react-native-movie-2.0-carousel-for-android.Please refer to *chirag prajapati* comment from the comments section. It seems that the problem is with MaskedView maskElement, it is too expensive to recalculate something that's moving so I opted-in for using *width* animation and remove the MaskedView completely since it's not performant of Android.

    • @666thales666
      @666thales666 4 роки тому

      @@CatalinMironDev Thanks! I didn't see the reference, sorry.
      This tip is worth two coffees

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому

      @@666thales666 Thank a lot Thales and I'm happy this worked for you. Thanks for the coffees in advance ❤️

  • @arrowfunction3200
    @arrowfunction3200 4 роки тому

    hi thanks for the video really usefull, i know nothing about reanimated v1 and v2 and i want to learn one of them should i start with v2 or v1 what do you suggest?

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому +1

      Thanks Kreb. To be honest, Reanimated2 is great and powerful, the only downside I'll say is that it is still in beta/alpha so is not that mature compared to Reanimated1. I'll create a course that will walk you through everything that you need to know about Reanimated2. I'll announce it here on the channel once it is ready!. Thanks!

  • @alex1000-gc
    @alex1000-gc 4 роки тому +1

    Hey Catalin! Firstly, thanks for the tutorials, I've seen a lot of them already.
    I have a doubt, I'm trying to animate the FlatList using the Reanimated v2, but I'm getting frame drops, which is making me start using the AnimatedAPI. Do you know how can I avoid frame drops on FlatLists using Reanimated v2? Anyone who sees this comment and is experiencing the same problem, know how to fix it?

    • @MerciBro
      @MerciBro 3 роки тому

      Had the same problem yesterday. I solved it by building some limitor algorithms for the data being passed into the list. What's weird is that if you map the same data in a scrollview, you dont get the frame rate drop.

  • @ahmedtoma8930
    @ahmedtoma8930 3 роки тому

    Good job 👏👏. Please make udemy course about react native animation from scratch. I think it will best course ever

  • @ludwigvillalba1886
    @ludwigvillalba1886 2 роки тому

    Thanks!

  • @soloogho4937
    @soloogho4937 3 роки тому

    can we have active index in this?

  • @rohanjoshi8420
    @rohanjoshi8420 3 роки тому

    I suggest you make step by step video of it this video on how you develop this project. because it is overwhelming to me to start to code. also not understand the entire code.

  • @mustafa-pt3sy
    @mustafa-pt3sy 4 роки тому

    Bro you are the best.
    Can you help me out to figure out how to make my flatlist to
    show the center card and not the first one?

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому

      So you'd like to have a gap at the beginning of the list or you'd like to have the first item starting from the left? Thanks Mustafa! ✌️

    • @mustafa-pt3sy
      @mustafa-pt3sy 4 роки тому +1

      @@CatalinMironDev I thought you won't answer me lol, thank you much.
      So the flat list shows from the first index to the last index.
      What I want is that my flat list shows the middle index when I render it.
      for example, the flat list will show the first movie (the kissing booth 2 movie) what do I want is to start my flatlist with the middle card like (Greyhound movie)
      sorry me English is not good, anyway if you don't get my question no problem,
      I would like to know if you don't pretend to make a course teaching those techniques from beginner to advanced

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому +1

      @@mustafa-pt3sy here's the solution:
      // Change initial scrollX and backdropAnimated to they will start from initialIndex value
      const initialIndex = 1;
      const scrollX = React.useRef(new Animated.Value(initialIndex * ITEM_SIZE)).current;
      const backdropAnimated = React.useRef(new Animated.Value(initialIndex * ITEM_SIZE)).current;
      // FlatList props add this props
      initialScrollIndex={initialIndex}
      getItemLayout={(data, index) => ({
      index,
      offset: ITEM_SIZE * index,
      length: data.length
      })}

  • @amershalata65
    @amershalata65 4 роки тому

    hi
    i have Question : setMovies([{ key: 'empty-left' }, ...movies, { key: 'empty-right' }]);
    what's that mean ?.
    i tryed to run it but give me tha worng:
    " Error: Too many re-renders. React limits the number of renders to prevent an infinite loop. "

    • @CatalinMironDev
      @CatalinMironDev  4 роки тому

      I actually explain why I’m doing this in the tutorial. This is mainly because I’d like to have the initial and last item in the middle of the screen.