🐛(react) resolve development warning in CalendarAux component

Resolve development warning in `CalendarAux` component caused
by recent updates to react-aria dependencies. Update props for next
and previous calendar buttons, removing `onFocusChange` before
passing to the Button component.
This commit is contained in:
Lebaud Antoine
2023-07-12 23:52:58 +02:00
committed by aleb_the_flash
parent e4c1df5b0b
commit c35cc603a7
2 changed files with 8 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
"@openfun/cunningham-react": patch
---
Fixed development warning in `CalendarAux` component

View File

@@ -174,16 +174,18 @@ const CalendarAux = forwardRef(
const downshiftMonth = useDownshiftSelect("month", monthItems);
const downshiftYear = useDownshiftSelect("year", yearItems);
// isDisabled and onPress props don't exist on the <Button /> component.
// isDisabled, onPress and onFocusChange props don't exist on the <Button /> component.
// remove them to avoid any warning.
const {
isDisabled: isPrevButtonDisabled,
onPress: onPressPrev,
onFocusChange: onFocusChangePrev,
...prevButtonOtherProps
} = prevButtonProps;
const {
isDisabled: isNextButtonDisabled,
onPress: onPressNext,
onFocusChange: onFocusChangeNext,
...nextButtonOtherProps
} = nextButtonProps;