Problem with random quote machine using React

hi ,can anybody help me,i don’t know why my react app is not rendering,here is my codepen of this app :

Make sure you save your pen. When I click on the pen, it is just the FCC template without any code.

i saved the pen,can you check it now please,scroll down the editor to see the code,it’s below the comments

You have a couple of issues.

#1) Because you are using Codepen, you can not use import. Instead, you need to add React and ReactDOM libraries to the JS Module. You can use which ever CDN version you want.

#2) You have the following button, but it is hard to see, because you did not provide any text.

    <button id="new-quote" onClick= {this.handleclick} >    

I suggest adding the words New Quote between the buttons tags.

Also, JavaScript is case-sensitive, so this.handleclick refers to a non-existent method. Check your spelling and you will see how to fix.

EDIT: Also, it seems you no longer have a div element with id=“quote-box” in your HTML section, so you will need to resolve that also.

thanks a lot for,i did all the things you said,and i still don’t see anything on my page.

I would have to investigate further, but the version of React and ReactDOM you chose have some errors showing in the console.

Change to the following and it should work:


1 Like

thanks a lot,it works!!!,i used the first and second one.