Does it makes sense to use tappable to implement a button?
0x80 opened this issue · comments
I was wondering if this makes any sense to you
<Tappable
className={buttonClasses}
onFocus={::this.handleFocus}
onBlur={::this.handleBlur}
onMouseEnter={::this.handleMouseEnter}
onMouseLeave={::this.handleMouseLeave}
onTap={::this.handleTap}
component={asLink ? 'a' : 'button' }
>
<span className={styles.content}>
{label}
</span>
</Tappable>
I am basically trying to use the tappable behavior for links and buttons. The problem I'm facing here is that if I set a property like "disabled" on my component I somehow needs to be passed down to the Tappable component. So I'm starting to wonder if this even makes sense.
Should I just use react-tap-event-plugin + a regular link/button? Are there any traps I should be aware of if I do that? I thought react-tappable soved a few issues I would have to solve manually for iOS if I use regular buttons/links.
I did something like this for yarr.js
You can take a look: https://github.com/nmn/yarr/blob/master/src/link.js
It doesn't have a disabled property, but that can easily be added.
Long story short, this is totally doable, but you will need to do some manual work to hook stuff up correctly.