Front end development certification: Random quote generator

hey there. I’ve been trying to implement the random quote generator however the codepen keeps producing an error that claims I did an unexpected declaration(token) in my React project. When I try to troubleshoot the error I realize that its referring to my declarations of div elements. It has therefore failed to run, link to code hereRandom Quote Generator . Please help me figure it out cause I’ve tried in vain.

Did you set up Your Code Pen JavaScript for the React?
You can do it settings or you can put in the head:

<script src="https://unpkg.com/react@17.0.1/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@17.0.1/umd/react-dom.development.js"></script>

set JavaScript Preprocessor to Babell…

You should use the href attribute in an anchor (<a> ) element, not in a button element.

<a
  id="tweet-quote"
  className="content-display"
  href="https://twitter.com/intent/tweet"
  target="_blank"
>
  <button  id="tweet-quote content-display">
    <i></i> Tweet
  </button>
</a>

and its working (you need scripts and babel)

1 Like

Thank you so much, I needed to set the preprocessor to Babel. Its running now. Just need to look for the run tests tab now.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.