А закидывать все файлы или только коммент и инпут?)
addComment = () => {
const { comment, userName, userText } = this.state;
if (userText === "" || userName === "") {
return alert("Введите значения");
}
const newComments = [
...comment,
{ name: userName, text: userText, data: this.getDate(), isActive: true }
];
this.setState({comment: newComments}, () => {
localStorage.setItem('comment', JSON.stringify(newComments));
this.setState({
userName: '',
userText: ''
})
})
};
не благодари