Full Stack React & Firebase: #25 Delete Button

preview_player
Показать описание
Adding a delete button to the user's screams for them to be able to delete them

-------

Join the community ;)

channel's website

-------

Рекомендации по теме
Комментарии
Автор

Just wanted to add that you're mutably editing the state in the dataReducers delete action which by everything else I've read about react & redux is not a good practice. I came up with this which I think is the more correct way to do it. Correct me if I'm wrong: case DELETE_SCREAM: {
let index = state.screams.findIndex(
scream => scream.screamId === action.payload
);
let mutatedScreams = state.screams.slice();
mutatedScreams.splice(index, 1);
return {
...state,
screams: [...mutatedScreams]
};
}

korzac
Автор

hey....when I refresh the page the handle is undefined and then gives an error... what could be the reason?

jennz
Автор

Thanks for the class. I don't see a link to the github repository.

eleah
Автор

Hi, is anyone getting the error screamId is not defined

geoffreyoliaro
Автор

What about:
right: '0',
    marginRight: '20px'
Makes it anchored to the right, not to the left, so a better use of the absolute property.

jornejongsma