Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export default function messages(state = getMessages(10), action) {
- switch (action.type) {
- case SEND_MESSAGE:
- const { message, userId } = action.payload;
- return {
- ...something
- }
- }
- };
- case EDIT_MESSAGE:
- const { message, userId } = action.payload;
- return state;
- default:
- return state;
- }
- }
- ==> Syntax error : message et user_id déjà déclarés
- soluce possible :
- case SEND_MESSAGE: {
- const { message, userId } = action.payload;
- return {
- ...something
- }
- }
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement