payloed Flashcards

1
Q

payloed - если необходимо прописывать пропсы при вызове функции в разном порядке

A

В App
function changeStatus(payload: {taskId: string, todolistId: string, isDone: boolean}){
const {taskId, todolistId, isDone} = payload
}
В Todolist
type PropsType = {
changeTaskStatus: (payload: {todolistId: string, taskId: string, iisDone: boolean}) => void
}

const onChangeHandler = (e: ChangeEvent<HTMLInputElement>) => {
props.changeTaskStatus({todolistId: props.todolistId, taskId: t.id, isDone: e.current.target.checked})
}</HTMLInputElement>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly