MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / Header

Class Header

code/composition/src/Header.jsx:4–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2import PropTypes from 'prop-types';
3
4export default class Header extends React.Component {
5 render() {
6 return (
7 <header>
8 <a className='button' onClick={ this._logoClicked.bind(this) }>
9 Logo
10 </a>
11 <hr />
12 { this.props.title }
13 <hr />
14 { this.props.children }
15 </header>
16 );
17 }
18 _logoClicked() {
19 this.props.track && this.props.track('logo-clicked');
20 }
21};
22
23Header.propTypes = {
24 title: PropTypes.any,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected