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 (
Welcome to React
Everyone is welcome!
To get started, edit src/App.js
and save to reload.
{this.state.on ? "Yes!" : "No!"}
{this.state.input}
this.setState({ input: e.currentTarget.value })} />
{this.state.lifeCycle}
);
}
}
App.displayName = appName;
Title.displayName = titleName;
export { App, Link, appName, titleName };