-
Notifications
You must be signed in to change notification settings - Fork 1
React project #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
React project #28
Conversation
added portfolio web
| const ProgressBar:FC<ProgressBarProps>=({onComplete, color = "#0000FF", duration = 5000})=> { | ||
| const [progress, setProgress] = useState(0); | ||
| const step = 100/(duration/50); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Step calculation isn't required. Also use useRef for storing setInterval
| setUsers(result) | ||
| }) | ||
| } else { | ||
| throw new Error(`HTTP error! Status: ${response.status}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can set the error here too, instead of throwing the error.
| //status code | ||
| // we got the response | ||
| response.status | ||
| response.json().then(result => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to capture the error for this json parsing too.
No description provided.