-
Notifications
You must be signed in to change notification settings - Fork 17
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
Half finished #7
base: master
Are you sure you want to change the base?
Conversation
} | ||
//Getting requests, setting them in state. Getting reviews, setting them in state. | ||
componentDidMount() { | ||
if (!localStorage.getItem("requests")) { |
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.
It seems like too much work reading a value from localStorage, setting in localStorage and then reading it again. Why not read it and if it is not set then just a an empty array locally, instead of writing it to localStorage and reading it back.
@@ -0,0 +1,24 @@ | |||
import React from "react"; | |||
//not sure I need the spread operator actually | |||
function CurrentReviews({ reviews }, ...props) { |
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.
not sure the spread operator helps here. you can either just use props object as a parameter or destructure it to extract all its values into own variables
return ( | ||
<main className="feed"> | ||
<ul> | ||
{requests ? ( |
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.
when there are no requests it would be better to store it as an empty array and check the length property of the array to check if there is no data
Good work |
No description provided.