Giter Site home page Giter Site logo

ainurb / react-native-segment-control Goto Github PK

View Code? Open in Web Editor NEW
23.0 0.0 7.0 936 KB

Swipeable SegmentedControl component for React Native apps

License: MIT License

JavaScript 41.21% Python 14.42% Java 11.73% Objective-C 32.63%
segment control swipe tabs segmentedcontrol swipeable react-native animated animated-tabs

react-native-segment-control's People

Contributors

ainurb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-segment-control's Issues

How could I add an onPress function to update the selected tab?

Hi,

I like your segment control, it's really cool! I see it works best for static content but I'm trying to use it to serve dynamic content. I figured, adding an onPress function to it will help me update the selected index and thus be able to change state. I'm new to react so I'm struggling to figure this out. Any ideas on how I can achieve this?

warn: Animated.event now requires a second argument for options

react-native: 0.68.6
react: 17.0.2
react-native-segment-control: 1.0.5

Swipe and click encounter warn: Animated.event now requires a second argument for options
Solution:
react-native-segment-control/index.js (116)
Original code:

handleOnScroll = x => {
    const mover = Animated.event([
      { nativeEvent: { contentOffset: { x: this.state.scrollX } } }
    ]);
    mover(x);
  };

Suggest changes:

handleOnScroll = x => {
    const mover = Animated.event([
      { nativeEvent: { contentOffset: { x: this.state.scrollX } } }
    ], {useNativeDriver: false});
    mover(x);
  };

warn Reason: a second argument for options

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.