I wanted to be able to use your Tappable component for a link tag (a). Unfortunately, the current implementation did not allow me to add arbitrary attributes like id or href (unless I overlooked sth.). Therefore I tried to refactor the code such that it is also available as a mixin. A component using the mixin would look sth. like the following:
var React = require('react');
var Tappable = require('react-tappable');
var TouchLink = React.createClass({
mixins: [Tappable.Mixin],
render: function() {
return (
<a id="foo" href="http://www.google.ch" style={this.touchStyles()} {...this.handlers()}>Link</a>
);
}
});
module.exports = TouchLink;
The functionality of the original component should still be the same (the example still working without changes).
I wanted to be able to use your Tappable component for a link tag (a). Unfortunately, the current implementation did not allow me to add arbitrary attributes like id or href (unless I overlooked sth.). Therefore I tried to refactor the code such that it is also available as a mixin. A component using the mixin would look sth. like the following:
The functionality of the original component should still be the same (the example still working without changes).
What do you think?