React Native Tutorial - 13 - Pressable

Sdílet
Vložit
  • čas přidán 22. 07. 2023
  • 📘 Courses - learn.codevolution.dev/
    💖 Support UPI - support.codevolution.dev/
    💖 Support Paypal - www.paypal.me/Codevolution
    💾 Github - github.com/gopinav
    📱 Follow Codevolution
    + Twitter - / codevolutionweb
    + Facebook - / codevolutionweb
    📫 Business - codevolution.business@gmail.com
    Pressable
    React Native Tutorial
    React Native Tutorial for Beginners

Komentáře • 19

  • @VetrivelDhanush
    @VetrivelDhanush Před 10 měsíci +8

    one small correction
    order of events trigger
    1.onPressIn
    2.onPress
    3.onPressOut
    for long press
    1.onPressIn
    2.onLongPress
    3.onPressOut

  • @tbm1895
    @tbm1895 Před 6 měsíci +1

    They are working as expected : )

  • @michealskup5730
    @michealskup5730 Před 11 měsíci

    That was helpful, thank you!

  • @hunglemanh6535
    @hunglemanh6535 Před měsícem +1

    3:36
    the correct flow is:
    onPressIn => onPress => onPressOut

  • @MinisterGold
    @MinisterGold Před 5 měsíci

    Also, is there any reason why you would use TouchableOpacity instead of Pressable or vice versa?

  • @MinisterGold
    @MinisterGold Před 5 měsíci

    I noticed images can't handle onPress events but Text can. So, I guess with Text, you would only use Pressable when you're want an onPress event on more than one consecutive Text component at a time.

  • @kevincliffpomar1634
    @kevincliffpomar1634 Před 11 měsíci

    Bro! you have the react native dedicated playlist for this? I'm currently at EP 26 of your react js. im planning to proceed on native😊

  • @hunglemanh6535
    @hunglemanh6535 Před měsícem

    How about TouchableOpacity and TouchableHighlight? Are these deprecated?

  • @Azer_Oner
    @Azer_Oner Před 10 měsíci

    What’s difference between Pressable and TouchableOpacity please ? And which it’s preferable to use ?

    • @auronvila1069
      @auronvila1069 Před 9 měsíci +2

      In US we say same sh*t different toilet :)

    • @klirmio21
      @klirmio21 Před 8 měsíci +3

      TouchableOpacity is deprecated now by the official docs, they encourage to use Pressable now.
      As far as I understood they are both basically the same, used to wrap around an element which is not usually pressable, but then you can press on it and attach a onPress event listener to Pressable and basically make any element pressable
      The difference is that TouchableOpacity provide a out of the box opacity fading upon press (visual indication that you pressed the button), but Pressable does not provide any feedback.

  • @ramakrishna-hw5bg
    @ramakrishna-hw5bg Před 2 měsíci

    Can we differentiate ios and android press

    • @Neil_09
      @Neil_09 Před 2 měsíci

      Yes, he says which one, the iOS and android. Also, the iOS button does not have a blue padding around it. Listen closely.

  • @rishiraj2548
    @rishiraj2548 Před 11 měsíci

    👍🙏

  • @ApexModi6000
    @ApexModi6000 Před 11 měsíci

    First

  • @seddeknadhem5638
    @seddeknadhem5638 Před 11 měsíci

    import React, { useState } from "react";
    import { Pressable, View, Text } from "react-native";
    const MyComponent = () => {
    const [count, setCount] = useState(0);
    const onPress = () => {
    setCount(count + 1);
    };
    return (


    Press Me

    Count: {count}

    )
    }
    export default MyComponent;

    • @Jykobe491
      @Jykobe491 Před 7 měsíci

      Jesse wtf are you talking about?

  • @ryansatriayudha
    @ryansatriayudha Před 6 měsíci

    I tried