import React, {Component, PropTypes} from 'react'; import {shell} from 'electron'; class Link extends Component { render () { const {button, href, children, ...other} = this.props; return button ? ( ) :( {e.preventDefault(); shell.openExternal(href)}} {...other}> {children} ) } } Link.propTypes = { href: PropTypes.string.isRequired, // Optional button: PropTypes.bool }; export default Link;