codedamn

Random quote generator

Created by Codedamn about a year ago

0

No description provided

6 Comments

    0

    just use 0.8x speed for those who don't catch up very well.

    @hv7460

    Himanshu Anand

    @hv7460

    2

    such a good project as a beginner. i made my own using this concept ----> https://react-quote-generator-sigma.vercel.app/

    @ahir8125

    chirag

    @ahir8125

    3

    Lol love how you saw afraid was spelt incorrectly as afriad and then you deleted and changed it to exactly what it was before...

    @alistairheus

    Kartik Jha

    @alistairheus

    1

    import "./styles.css"; import {useState} from 'react' const animals = ['Bear', 'cheetah', 'Crocodile', 'Fox', 'Lion', 'Shark', 'Snake', 'Tiger']; export default function App() {

    const [oldAnimal,setAnimal] = useState(animals[0]);
    const randomAnimal = animals[Math.floor(Math.random() * animals.length)]
    function buttonClicked() {
      setAnimal (randomAnimal)
    }
    

    return ( <div className="App"> <h2>{oldAnimal}</h2> <button onClick ={buttonClicked}>New Animal</button> </div> ); }

    Why this code is not generating random animals after some clicks

    @ayushartist

    ayush singh

    @ayushartist

    1

    I made my own random quote generator . Please check it out : https://master--moonlit-donut-7e8c15.netlify.app/

    @vishalkr17

    Vishal Kumar

    @vishalkr17

    0

    Check out my version of random quote generator. : https://tangerine-blini-d282d6.netlify.app/

    @udaynippulati

    Uday Nippulati

    @udaynippulati

Your comment