Inspiration

I wanted to try a project that utilized React and this seemed like something fun, short and that would help me understand better. I still have a hard time knowing about React!

What it does

Using React, this project will allow the user to click on a button and a random number from one to 1000 will be generated

How we built it

I created a component using JavaScript functions to first generate a random number, then created a button that would link to that function. Then an event listener (onClick) was added to the button so a new number would appear

Challenges we ran into

I forgot that I could not just put the number into the browser. It was then I understood I would need to update the state by using useState from React!

Accomplishments that we're proud of

I'm really happy I was able I was able to apply useState and to figure out what element I needed for the numbers to appear on the page. I also like how the css looks. Simple not overwhelming but pleasant.

What we learned

I learned better about how important useState is and how the setNumber is just a function that can change the values!

What's next for Random Number Generator

I'm not really sure. Perhaps I can add images that will change the images and add an API like unSplash?

Built With

Share this project:

Updates