Components in React. What are they?

                         This is staticclass Logo extends React.Component { // basic component syntax
render() {
return ( // necessary to actually output the data
<img src="twitterlogo.png"/>
)
}
}

This is dynamic
class PostText extends React.Component { // basic component syntax
render() {
return ( // necessary to actually output the data
<div>
{this.props.textContent} // dynamically insert values
</div>
)
}
}
<Post user='Cher' text='something something life after love'class Post extends React.Component {
render() {
return (
<div>
<h1>{this.props.user}</h1>
<h4>{this.props.text}</h4>
</div>
)
}
}
function Greeting(user){
return <div>Hello {user.name}</div>
}
Haha funny metaphor

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store