Learning REACT Chapter 4

Hi Kirupa,
I am a beginner in React and following your book. Got stuck in chapter 2. The code is not working. className not doing anything. If I use div div div it’s fine. If I change it to .letter - nothing is happening . Could you please enlighten me, what is that I am doing wrong? Here is the code:

<DOCTYPE html>



<meta charset = "utf-8">

<title>React ! React ! React!</title>

<script src="https://unpkg.com/[email protected]/umd/react.development.js"></script>

<script src="https://unpkg.com/[email protected]/umd/react-dom.development.js"></script>

<script src="https://unpkg.com/[email protected]/babel.min.js"></script>


  .letter {

   padding: 10px;

   margin: 10px;

   background-color: #FFDE00;

   color: rgb(118, 26, 223);

   display: inline-block;

   font-family: monospace;

   font-size: 48px;

   text-align: center;




<div id="container" >

<script type="text/babel">

var destination = document.querySelector("#container");

class Letter extends  React.Component{



      <div className="letter" >



















It is because you aren’t using the Letter component :slight_smile:

If you replace the child div elements in your render function with the Letter element, you’ll see the correct behavior.