This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"main": 'Button.js' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return ( | |
<div> | |
<li>Content</li> | |
</div> | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return ( | |
<li>Content</li> | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo extends Components { | |
constructor(props) { | |
super(props); | |
this.state = { message: "Hello" }; | |
} | |
logMessage() { | |
const { message } = this.state; | |
console.log(message); | |
} | |
render() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Bar extends Components { | |
constructor(props) { | |
super(props); | |
this.state = { message: "Hello" }; | |
} | |
logMessage() { | |
const { message } = this.state; | |
console.log(message); | |
} | |
render() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hello extends Components { | |
constructor(props) { | |
super(props); | |
this.state = { message: "Hello" }; | |
this.logMessage = this.logMessage.bind(this); | |
} | |
logMessage() { | |
const { message } = this.state; | |
console.log(message); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Message extends Components { | |
constructor(props) { | |
super(props); | |
this.state = { message: "Hello" }; | |
} | |
logMessage = () => { | |
const { message } = this.state; | |
console.log(message); | |
} | |
render() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from "react"; | |
import PropTypes from "prop-types"; | |
class Welcome extends Component { | |
render() { | |
const { name } = this.props; | |
return <h1>Welcome, {name}</h1>; | |
} | |
} |