react-datepicker icon indicating copy to clipboard operation
react-datepicker copied to clipboard

TypeError: Cannot read properties of undefined (reading 'holidays') Getting an error after minifying my code

Open sathish869 opened this issue 2 years ago • 1 comments

I have used the react date picker like this

<DatePicker selected={ instSumObject && instSumObject.to_date ? instSumObject.to_date : "" } holidays={[]} onChange={(date) => handleDateChange(date, "to_date")} dateFormat="MM/dd/yyyy" autoComplete="off" minDate={calculateMinDate("to_date")} maxDate={new Date()} id="to_date" customInput={<input className="form-control ml-1" />} />

If im not minifying the code, it is working fine,but after minifying im getting the error like this 

react-dom.production.min.js:4147 TypeError: Cannot read properties of undefined (reading 'holidays')
at n.calcInitialState (react-datepicker.min.js:2833:1)
at new n (react-datepicker.min.js:3294:10)
at wa (react-dom.production.min.js:2608:1)
at Ui (react-dom.production.min.js:3552:1)
at bu (react-dom.production.min.js:5480:1)
at bl (react-dom.production.min.js:5035:1)
at gl (react-dom.production.min.js:5029:21)
at cl (react-dom.production.min.js:4815:1)
at react-dom.production.min.js:2331:1
at t.unstable_runWithPriority (scheduler.production.min.js:252:1)


what is the root cause for this?

sathish869 avatar Oct 12 '23 06:10 sathish869

image

sathish869 avatar Oct 12 '23 06:10 sathish869

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 10 days.

github-actions[bot] avatar May 29 '24 01:05 github-actions[bot]