JedWatson / react-tappable

Tappable component for React

Home Page:http://jedwatson.github.io/react-tappable/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to add properties to a Tappable component?

jacobedawson opened this issue · comments

Hi,

Tappable is awesome, really nice out of the box :)

I'm sure this is a ridiculously stupid question, but how do I add properties to a Tappable instance?

In my code I can do something like

<Tappable onPress={this.example} onTap={this.anotherexample} ...etc

and it works perfectly. But I can't work out from the code here on the repository how to add a property - for example; how to set pressDelay to 400ms.

If you (or anyone that views this) can help a noob out that would be very welcome ;)

I'm using React 0.14 with JSX if that helps (and haven't converted to ES6 yet).

Cheers,

Jake

@jacobedawson you can pass them just as props.

<Tappable onPress={this.example} onTap={this.anotherexample} pressDelay={400} ...etc

See here for all the props that are accepted: https://github.com/JedWatson/react-tappable/blob/master/src/TappableMixin.js