skip to Main Content

I’m using primereact’s calendar component. I have a prop

numberOfMonths={18}

To give me 18 months/columns. Problem with that is that it generated every additional month after 12 with same children element keys, so I get a bunch of these errors:

Warning: Encountered two children with the same key, `8`. Keys should be unique so that components maintain their identity across updates.....

Is there any way around this so that primereact generates additional months with unique keys? Thanks.

This is how my full component with props looks like:

<Calendar value={dates} onChange={(e : CalendarChangeEvent) =>  verticalDateHandler(e.value)}numberOfMonths={18} minDate={today} selectionMode="range" dateFormat="YYYY MMM DD" touchUI inline viewDate={today}/>

Tried removing "touchUI", tried removing viewDate prop, tried updatingLocale with extra month names. No dice.

2

Answers


  1. Chosen as BEST ANSWER

    Seems to be just a bug with no solution right now.

    reported it on GitHub issues


  2. It will be fixed in 9.3.1+ with this fix: https://github.com/primefaces/primereact/pull/4260

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search