DefinitelyTyped/react-swipeable-views/react-swipeable-views-tests.ts
2016-05-10 16:27:59 -07:00

30 lines
666 B
TypeScript

import * as React from 'react';
import SwipeableViews from 'react-swipeable-views';
const onChangeIndex = (indexNew:number, indexLatest:number) => {
console.log('New index: ' + indexNew + ', latest index' + indexLatest);
};
const onSwitching = (index:number) => {
console.log('Switching to ' + index);
};
const style:React.CSSProperties = {
height: 300
};
React.createElement(SwipeableViews, {
containerStyle: style,
disabled: false,
index: 0,
onChangeIndex: onChangeIndex,
onSwitching: onSwitching,
resistance: false,
slideStyle: style,
style: style,
threshold: 100
});
React.createElement(SwipeableViews, {});