Measures with Reanimated 2

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

КОМЕНТАРІ • 34

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

    This video just got me out of a sticky situation. Thanks for all you do, William.

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

    Amazing as always. Thanks Willian!

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

    You are god's gift to mobile developer

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

    Merci d'exister mec. tes tutos me sont vachement utiles pour mes applis

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

    boooom! nice one. this is awesome 🥳

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

    Terrific video William, this is really handy since it's a very common use case! Just want to point that the Chevron direction gets inverted. It the interpolation should be mix(transition.value, 0, Math.PI) instead

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

    is there a way to use measure without using react-native-reanimated? say i just wanted to measure a View component. although the `measure` function on the ViewRef will return 1 if the height is 1 even though there is content/children in the View 🤔

  • @abbasali-o8k
    @abbasali-o8k Рік тому +1

    Hey William, thanks for the tutorial, it seems, the measure is not able to measure the accurate height, cause, the onLayout height, is showing a different height.
    Edit -
    It seems adding position: 'absolute' to the View, let's us get the accurate height, why would that be?

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

      This is the key. Without position absolute, there will be race conditions in measuring the new height. With absolute position, the content is rendered, but invisible because overflow is set to hidden. We got the height to animate to with the position absolute. No need for 1 too!

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

    what can I do for dynamic height content?

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

    great tutorial , thanks for making such videos

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

    Again a great tutorial. However I wonder js there any way we can reduce all these boilerplate code ? For animations even the simple ones we always end up doing a lot of code and measurmenta while keeping our api calls and business logic.
    With reanimated 2 seems like it has a much smoother syntax and readability but in reanimated 1 it was a nightmare

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

    Awesome! Thank you, William.

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

    It's nice, but the list item has a static height. What if the list item height is not known in advance? The measure function doesn't work properly in these cases.

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

      didn't we make so that the height is not know in advance?

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

      @@wcandillon I think Sivan means on the ListItem stylesheet container. I am facing the same issue where if I remove the const LIST_ITEM_HEIGHT from the container in the ListItem stylesheet, then this doesn't seem to calculate correctly.

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

      @@joshhwb you can reset the height to 0 when the data is changing .

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

      I was following along with my own implementation and it was not working at all. This turned out to be my exact issue. If the hidden items don't have a height set, the measure function does not work properly. Without a height, it was expanding very short and not the true dynamic height.
      It's not really dynamic or applicable to other implementations without a height set....

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

      You can use this to get a dynamic height whateve the the content heght is
      export default ({
      children,
      expanded,
      }: {
      children: React.ReactNode
      expanded: boolean
      }) => {
      const [height, setHeight] = useState(0)
      const animatedHeight = useSharedValue(0)
      const onLayout = (event: LayoutChangeEvent) => {
      const onLayoutHeight = event.nativeEvent.layout.height
      if (onLayoutHeight > 0 && height !== onLayoutHeight) {
      setHeight(onLayoutHeight)
      }
      }
      const collapsableStyle = useAnimatedStyle(() => {
      animatedHeight.value = expanded ? withSpring(height) : withTiming(0)
      return {
      height: animatedHeight.value,
      opacity: expanded ? withTiming(1) : withTiming(0),
      }
      }, [expanded])
      return (

      {children}

      )
      }

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

    This new Api is stupid awesome

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

    Can I use reanimated v2albha without terning enabling hermes?

  • @neos.nguyen
    @neos.nguyen 4 роки тому

    Cool! Thank you, William.

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

    after adding the alpha.5 version it cant find useAnimatedRef

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

    how to create animation appbar equal linkedin

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

    Really great stuff, love your videos! It looks amazing on iOS but I'm having problems with measure() on Android, do you know any workaround?

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

      Nvm found a good workaround for it here ua-cam.com/video/nT_vSzJr-vE/v-deo.html
      Just change this guys code to "height.value = nativeEvent.layout.height;" in the handleEvent function and you're set

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

    Can you do Facebook header animation when scrolling?

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

    Can please make header animation video of Facebook

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

      could you please share a screen recording with me at wcandillon@gmail.com? Which animation exactly?

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

    Nice tutorial :D

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

    hi ,i have question,
    how can upload video to firebase ?
    and Thank you for great job

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

    I love your videos , but i hate how you make me feel like a noob again :)

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

    Is this guy French or sth?