You could add an inputRef to your DatePicker component as:
<DatePicker inputRef={inputRef} .... , where
const inputRef = React.useRef<any | null>(null) and when there is an error, you can focus the inputRef like:
setTimeout(() => inputRef.current?.focus())