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

Class Title

code/communication/src/app.jsx:5–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3import PropTypes from 'prop-types';
4
5class Title extends React.Component {
6 constructor(props) {
7 super(props);
8 this._clickHandler = this._clickHandler.bind(this);
9 }
10 _clickHandler() {
11 console.log(this.props.children);
12 }
13 render() {
14 return (
15 <h1>
16 <a onClick={this.props.logoClicked}>
17 <img src='data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0xMS41IC0xMC4yMzE3NCAyMyAyMC40NjM0OCI+CiAgPHRpdGxlPlJlYWN0IExvZ288L3RpdGxlPgogIDxjaXJjbGUgY3g9IjAiIGN5PSIwIiByPSIyLjA1IiBmaWxsPSIjNjFkYWZiIi8+CiAgPGcgc3Ryb2tlPSIjNjFkYWZiIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiPgogICAgPGVsbGlwc2Ugcng9IjExIiByeT0iNC4yIi8+CiAgICA8ZWxsaXBzZSByeD0iMTEiIHJ5PSI0LjIiIHRyYW5zZm9ybT0icm90YXRlKDYwKSIvPgogICAgPGVsbGlwc2Ugcng9IjExIiByeT0iNC4yIiB0cmFuc2Zvcm09InJvdGF0ZSgxMjApIi8+CiAgPC9nPgo8L3N2Zz4K' width='30'/>
18 </a>
19 { this.props.text }
20 { this.props.children }
21 <a onClick={this._clickHandler}>click me</a>
22 </h1>
23 );
24 }
25};
26Title.propTypes = {
27 logoClicked: PropTypes.func,
28 text: PropTypes.string,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected