Create a Stateless Functional Component - confused

Create a Stateless Functional Component - confused
0

#1

Tell us what’s happening:
I am having a hard time understanding what this assignment is trying to accomplish as well as understanding the instructions.

Your code so far


const MyComponent = function() {
  // change code below this line

return (<div className="some string of text" />
);

  // change code above this line
}

Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 7.0; LGMS210 Build/NRD90U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.109 Mobile Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/front-end-libraries/react/create-a-stateless-functional-component


#2

The string of text goes between <div> and </div>, just like plain HTML. className is where you put HTML classes that you want to put in the component


#3

it should be like this:

return ( <div> "some string of text" </div>)


#4

Tried that. Didn’t work.


#5

Hi Andrew! I tried again, this morning. Your solution works. Thank you. What is the purpose of div?


#6

<div something/> is to add a property to the div tag.
<div> something </div>is to add text in the div.
just like <h1 color: "red"> </h1> and<h1>color: "red"</h1>
you can try the code to see the difference.


#7

That is a good explanation. Thank you, Andrew! :sunny: