react touchable component. inspired by react-native.
import Touchable from 'rc-touchable';
ReactDOM.render(<Touchable onPress={onPress} activeClassName="active">
<div>click</div>
</Touchable>, container);
name | type | default | description |
---|---|---|---|
disabled | boolean | false | |
onPress | ()=>void | onPress/onTap callback | |
onLongPress | ()=>void | onLongPress/onLongTap callback | |
activeClassName | string | className applied to child when active | |
activeStyle | object | style applied to child when active | |
activeStopPropagation | object | stop child active propagate to parent |
npm install
npm start
http://localhost:8007/examples/
online example: http://react-component.github.io/touchable/
npm test
npm run chrome-test
npm run coverage
open coverage/ dir
rc-touchable is released under the MIT license.