Your Feedback : Random Quote Machine

Your Feedback : Random Quote Machine
0

Here is my first front-end project and the first react project Random Quote Machine Live app,
GitHub repo
I’m new at using react.js, so I hope I’ll get great advice, comments, ideas, suggestions from your feed back so I can improve and do better in the next projects.

This is some good written code, but logic is bit off to my taste. 4 simple rules:

  1. if there’s an error while fetching - the only way to re-try is to reload page, because ‘New Quote’ button would do exactly nothing - no dead UI elements.
  2. data should not be a state - this.quotes would be your cache and this.state.quoteIndex would store the index of your cache (you do not store data twice) to display
    …and then you would have something like: setNewIndex(quotes.length, current) with current to make sure you exclude currently shown quote - anything could happen
1 Like

Thanks @iiiked for taking time to look at it, one of the things that I haven’t got well is how to manage well state of the app, but I’ll work on it and try to improve it.