What must component class name begin with?
Capital letters
What must a component class include?
How can you call a component’s render method?
ReactDOM.render(
,
document.getElementById(‘app’)
);
Create a component that would render the following HTML code:
<blockquote> <p> What is important now is to recover our senses. </p> <cite> <a href="http://bit.ly/1LvSLUA"> Susan Sontag </a> </cite> </blockquote>
import React from ‘react’;
import ReactDOM from ‘react-dom’;
class QuoteMaker extends
React.Component {
render() {
return (
<blockquote>
<p>
What is important now is to recover our senses.
</p>
<cite>
<a href="http://bit.ly/1LvSLUA">
Susan Sontag
</a>
</cite>
</blockquote>
);
}}
ReactDOM.render(
,
document.getElementById(‘app’)
);
Create a component that would render the following HTML code:
const owl = {
title: “Excellent Owl”,
src: “https://s3.amazonaws.com/codecademy-content/courses/React/react_photo-owl.jpg”
};
import React from ‘react’;
import ReactDOM from ‘react-dom’;
class Owl extends React.Component {
render() {
return (
<div>
<h1>{owl.title}</h1>
<img>
</div>
);}
}
ReactDOM.render(
,
document.getElementById(‘app’)
);