🎯 Datepicker을 이용해 완료 목표일 입력하기

// TodoCreate.tsx
const TodoCreate = ({ nextId, createTodo, incrementNextId }: TodoCreateProps) => {
  const [startDate, setStartDate] = useState('');;
	const [deadline, setDeadline] = useState('');

  const handleDateChange = (_: any, dateStrings: [string, string]) => {
    const [start, end] = dateStrings;
    setStartDate(start);
    setDeadline(end);
  };

  return (
    <>
      <InsertFormPositioner>
        <InsertForm>
          <Input />
          <RangePicker onChange={handleDateChange} />
          <CircleButton />
        </InsertForm>
      </InsertFormPositioner>
    </>
  );
};
// ITodo type
export type Itodo = {
  id: number;
  text: string;
  done: boolean;
  startDate: string;
  deadline: string;
};

// TodoCreate
createTodo({
      id: nextId,
      text: value,
      done: false,
      startDate,
      deadline,
    });

🎯 TodoList에 완료 목표일 넣기

const TodoItem = ({ toggleTodo, removeTodo, todo }: TodoItemProps) => {
  const { id, text, done, startDate, deadline } = todo;

  return (
    <TodoItemBlock>
			...
      <DateText done={done}>
        {startDate} ~ {deadline}
      </DateText>
			...
    </TodoItemBlock>
  );
};