react-day-picker 8.10.0 → 8.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -9
- package/dist/index.d.ts +49 -46
- package/dist/index.esm.js +56 -1409
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +84 -1437
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -10
- package/dist/index.min.js.map +1 -1
- package/package.json +4 -4
- package/src/DayPicker.tsx +3 -1
- package/src/components/Button/Button.tsx +2 -1
- package/src/components/Caption/Caption.tsx +4 -2
- package/src/components/CaptionDropdowns/CaptionDropdowns.tsx +3 -1
- package/src/components/CaptionLabel/CaptionLabel.tsx +3 -1
- package/src/components/CaptionNavigation/CaptionNavigation.tsx +2 -2
- package/src/components/Day/Day.tsx +2 -1
- package/src/components/DayContent/DayContent.tsx +3 -1
- package/src/components/Dropdown/Dropdown.tsx +3 -2
- package/src/components/Footer/Footer.tsx +3 -1
- package/src/components/Head/Head.tsx +3 -1
- package/src/components/HeadRow/HeadRow.tsx +3 -1
- package/src/components/IconDropdown/IconDropdown.tsx +3 -1
- package/src/components/IconLeft/IconLeft.tsx +3 -1
- package/src/components/IconRight/IconRight.tsx +3 -1
- package/src/components/Months/Months.tsx +2 -2
- package/src/components/MonthsDropdown/MonthsDropdown.tsx +2 -2
- package/src/components/Navigation/Navigation.tsx +2 -2
- package/src/components/Root/Root.tsx +2 -1
- package/src/components/Row/Row.tsx +3 -1
- package/src/components/Table/Table.tsx +3 -1
- package/src/components/WeekNumber/WeekNumber.tsx +2 -2
- package/src/components/YearsDropdown/YearsDropdown.tsx +2 -2
- package/src/contexts/DayPicker/DayPickerContext.tsx +3 -2
- package/src/contexts/Focus/FocusContext.tsx +3 -2
- package/src/contexts/Modifiers/ModifiersContext.tsx +3 -2
- package/src/contexts/Navigation/NavigationContext.tsx +3 -2
- package/src/contexts/RootProvider.tsx +14 -4
- package/src/contexts/SelectMultiple/SelectMultipleContext.test.ts +1 -1
- package/src/contexts/SelectMultiple/SelectMultipleContext.tsx +4 -3
- package/src/contexts/SelectRange/SelectRangeContext.test.ts +1 -1
- package/src/contexts/SelectRange/SelectRangeContext.tsx +4 -3
- package/src/contexts/SelectSingle/SelectSingleContext.test.ts +1 -1
- package/src/contexts/SelectSingle/SelectSingleContext.tsx +4 -3
- package/src/hooks/useControlledValue/useControlledValue.test.ts +1 -1
- package/src/hooks/useDayEventHandlers/useDayEventHandlers.tsx +1 -1
- package/src/hooks/useDayRender/useDayRender.tsx +2 -1
- package/src/hooks/useDayRender/utils/getDayStyle.ts +1 -1
- package/src/hooks/useInput/useInput.ts +3 -3
- package/src/types/DayPickerBase.ts +15 -15
- package/src/types/EventHandlers.ts +1 -1
- package/src/types/Formatters.ts +1 -1
- package/src/types/Modifiers.ts +1 -1
- package/src/types/Styles.ts +1 -1
- package/src/hooks/useId/useIsomorphicLayoutEffect.ts +0 -31
package/src/types/Modifiers.ts
CHANGED
package/src/types/Styles.ts
CHANGED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { useEffect, useLayoutEffect } from 'react';
|
|
2
|
-
|
|
3
|
-
import { canUseDOM } from './useId';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* React currently throws a warning when using useLayoutEffect on the server. To
|
|
7
|
-
* get around it, we can conditionally useEffect on the server (no-op) and
|
|
8
|
-
* useLayoutEffect in the browser. We occasionally need useLayoutEffect to
|
|
9
|
-
* ensure we don't get a render flash for certain operations, but we may also
|
|
10
|
-
* need affected components to render on the server. One example is when setting
|
|
11
|
-
* a component's descendants to retrieve their index values.
|
|
12
|
-
*
|
|
13
|
-
* Important to note that using this hook as an escape hatch will break the
|
|
14
|
-
* eslint dependency warnings unless you rename the import to `useLayoutEffect`.
|
|
15
|
-
* Use sparingly only when the effect won't effect the rendered HTML to avoid
|
|
16
|
-
* any server/client mismatch.
|
|
17
|
-
*
|
|
18
|
-
* If a useLayoutEffect is needed and the result would create a mismatch, it's
|
|
19
|
-
* likely that the component in question shouldn't be rendered on the server at
|
|
20
|
-
* all, so a better approach would be to lazily render those in a parent
|
|
21
|
-
* component after client-side hydration.
|
|
22
|
-
*
|
|
23
|
-
* https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85
|
|
24
|
-
* https://github.com/reduxjs/react-redux/blob/master/src/utils/useIsomorphicLayoutEffect.js
|
|
25
|
-
*
|
|
26
|
-
* @param effect
|
|
27
|
-
* @param deps
|
|
28
|
-
*/
|
|
29
|
-
export const useIsomorphicLayoutEffect = canUseDOM()
|
|
30
|
-
? useLayoutEffect
|
|
31
|
-
: useEffect;
|