React (11) 썸네일형 리스트형 Failed prop type: invaild prop value[0] of type String supplied to DataRangePicker, expcted instance of 'Date' 오류 오류 메시지:Failed prop type: Invalid prop `value[0]` of type `String` supplied to `DateRangePicker`, expected instance of 'Date'이 메시지는 다음과 같은 핵심 내용을 담고 있습니다:DateRangePicker에 넘긴 value의 항목이 Date 인스턴스가 아니라 문자열(string) 이라는 뜻입니다.즉, selectRow.excludeDt = ['2025-06-11', '2025-06-12']처럼 문자열이 들어가 있었기 때문입니다.✅ 1. 원인 분석selectRow.excludeDt?.[0] = selectRow.excludeFromDt;이 코드에서 selectRow.excludeFromDt와 selectRow... React 17 + TypeScript에서 onLoad 이벤트 구현 예제 # React 17 + TypeScript에서 컴포넌트 로드 완료 시점 감지하기 React에서 컴포넌트가 완전히 로드되었을 때(마운트 완료 시) 한 번 실행되는 효과를 구현하는 방법은 여러 가지가 있습니다. 가장 일반적인 방법은 `useEffect` 훅을 사용하는 것입니다. ## 1. 기본적인 컴포넌트 로드 감지 (useEffect) import React, { useEffect } from 'react';const ComponentLoadExample: React.FC = () => { useEffect(() => { // 컴포넌트가 마운트된 후 한 번 실행됩니다. console.log('Component loaded!'); // cleanup 함수 (컴포넌트 언마운트 시 실행.. React 기준 변수에 따라 레이블 변경하는 방법 import React, { Component } from 'react';type MonitoringType = 'T' | 'S';interface Props { monitoringType: MonitoringType;}class MonitoringLabel extends Component { getLabel = (): string => { return this.props.monitoringType === 'T' ? 'Activity Name' : 'Monitoring Name'; }; render() { return ( {this.getLabel()} ); }}export default MonitoringLabel; import React, .. 이전 1 2 다음