import PropTypes from "prop-types"; import React, { Component } from "react"; import logo from "./logo.svg"; import "./App.css"; const appName = "MasterControlProgram"; const titleName = "heading"; class Link extends Component { render() { return this.props.hide ? null : Click; } } Link.propTypes = { address: PropTypes.string, hide: PropTypes.bool, }; const Title = ({ text }) =>
{text}
; Title.propTypes = { text: PropTypes.string, }; class App extends Component { state = { input: "", mainColor: "blue", on: false, lifeCycle: "", }; componentDidMount() { this.setState({ lifeCycle: "componentDidMount" }) } componentWillReceiveProps() { this.setState({ lifeCycle: "componentWillReceiveProps" }) } handleStrings(s) { return s === "Hello, world"; } render() { return (
logo

Welcome to React

Everyone is welcome!

<p className="App-intro"> To get started, edit <code>src/App.js</code> and save to reload. </p> <ul className="tyler"> <li>First</li> <li>Second</li> <li>Third</li> </ul> <p className="button-state">{this.state.on ? "Yes!" : "No!"}</p> <button onClick={() => this.setState({ on: true })}>Click</button> <h2>{this.state.input}</h2> <input type="text" onChange={(e) => this.setState({ input: e.currentTarget.value })} /> <p className="lifeCycle">{this.state.lifeCycle}</p> </div> ); } } App.displayName = appName; Title.displayName = titleName; export { App, Link, appName, titleName };