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

Develop #860

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

Develop #860

wants to merge 4 commits into from

Conversation

novak-k
Copy link

@novak-k novak-k commented Jul 19, 2023

DEMO LINK

initial commit done

Copy link

@VitaliyBondarenko1982 VitaliyBondarenko1982 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please provide demo link

? post
: null)}
>
{post.id !== selectedPostId ? 'Open' : 'Close'}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{post.id !== selectedPostId ? 'Open' : 'Close'}
{!isSelected ? 'Open' : 'Close'}

better to make variable const isSelected = post.id === selectedPostId and use in all places

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addded

Comment on lines 18 to 22
const [value, setValue] = useState({
name: '',
email: '',
body: '',
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make outside component constant with initial values and use in both places.
same for isError state

const initialValue = {
  name: '',
  email: '',
  body: '',
}
Suggested change
const [value, setValue] = useState({
name: '',
email: '',
body: '',
});
const [value, setValue] = useState(initialValue);

Comment on lines 58 to 62
setValue({
name: '',
email: '',
body: '',
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
setValue({
name: '',
email: '',
body: '',
});
setValue(initialValue);

@novak-k
Copy link
Author

novak-k commented Jul 20, 2023

@novak-k novak-k closed this Jul 20, 2023
@novak-k novak-k reopened this Jul 20, 2023
Copy link

@demetrxx demetrxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done 👍 Go ahead!

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.

3 participants