tristantzara
tristantzara

Reputation: 5897

React native tabview configure sliding speed

I'm using react native tab view https://github.com/react-native-community/react-native-tab-view to have something like a carousel. It seems to work fine, but the sliding transition is too fast for me. How can I configure it? Docs say that there's a configureTransition callback which should return the transition configuration, but doesn't say what's that configuration and how should it look like:

 configureTransition - optional callback which returns a configuration for 
 the transition, return null to disable animation

Please, help me to find out how to configure transition speed.

Upvotes: 0

Views: 1175

Answers (1)

vinayr
vinayr

Reputation: 11234

Transition spec is defined in this file.

  import { Animated } from 'react-native';

  _configureTransition = () => {
    return {
      timing: Animated.spring,
      tension: 300,
      friction: 100,
    };
  }

  render() {
    return (
      <TabViewAnimated
        ....
        configureTransition={this._configureTransition}
      />
    );
  }

Upvotes: 1

Related Questions