Random Quote Machine with React Hooks

Hi everyone :slight_smile:

I have finished building Random Quote Machine Project, please let me know what do you think and if there is anything you’d changed :slight_smile:

Cheers!

1 Like

I love the app, and the way you wrote the code is great.

I was only wondering, are you loading lodash only to generate a random number? That’s very easy to do with your own function and something like this:

Math.floor(Math.random()*arr.length)

I laugh with this catch error:

    .catch((error) => {
        console.log(error);
        setAuthorName("Maciek");
        setQuotedText("Something went wrong and we couldn't load the quote, please try again :)");
      });

Well done :slight_smile:


Offtrack: I’d do a fetch to some crazier quote’s source, I believe one is called bs so you get things like: ‘npm, component, loop’ , I’m not kidding.

1 Like

Thanks, I’m glad to hear that :smiley:

Yeah, I know it’s overkill haha but honestly I’ve never used lodash before and just wanted to give it a try even with something so simple as getting a random number :smiley:

Do you have a link maybe? I’d like to take a look but can’t find it :grin: