The code powering m.abunchtell.com https://m.abunchtell.com
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 

29 satır
568 B

  1. const Permalink = React.createClass({
  2. contextTypes: {
  3. router: React.PropTypes.object
  4. },
  5. propTypes: {
  6. href: React.PropTypes.string.isRequired,
  7. to: React.PropTypes.string.isRequired,
  8. children: React.PropTypes.node.isRequired
  9. },
  10. handleClick (e) {
  11. if (e.button === 0) {
  12. e.preventDefault();
  13. this.context.router.push(this.props.to);
  14. }
  15. },
  16. render () {
  17. const { href, children, ...other } = this.props;
  18. return <a href={href} onClick={this.handleClick} {...other}>{children}</a>;
  19. }
  20. });
  21. export default Permalink;