Skip to content
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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Half finished #7

wants to merge 7 commits into from

Conversation

ljsikuade
Copy link

No description provided.

}
//Getting requests, setting them in state. Getting reviews, setting them in state.
componentDidMount() {
if (!localStorage.getItem("requests")) {
Copy link
Contributor

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) {
Copy link
Contributor

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 ? (
Copy link
Contributor

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

@dmitrigrabov
Copy link
Contributor

Good work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants