Help on Random Quote Machine

Here is my link: Random Quote Machine - Replit

Ok. First of all the random index generator does not work secondly the react app and the IDE just randomly crash is there a way to fix this?

Just a reminder I still need help

The live preview url of your replit doesn’t seem to work well on my end. If it’s not back-end related, I suggest moving the code on codepen for our convenience, as well.

  1. You are invoking the onClick handler. You have to wrap it inside a function.
onClick={() => this.getQuote(Math.floor(Math.random() * 101))}
  1. You don’t need to bind the getQuote method if you use an arrow function.

Thank you! You have really helped. I have put your answer as the solution. (I also put down a confetti ball)

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