Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
seanrcollings committed Dec 3, 2024
1 parent 4cfc937 commit 61be30c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { createLeafComponent } from "@react-aria/collections";
import { IconButton } from "@components/Buttons/IconButton";
import { useConditionalPress } from "@hooks/useConditionalPress";
import { useFocusRing } from "@hooks/useFocusRing";
import { useContextPropsV2 } from "@hooks/useContextProps";
import { useContextProps } from "@hooks/useContextProps";
import { useRenderProps } from "@hooks";
import { ChipGroupStateContext } from "@components/Fields/ChipGroupField/ChipGroupField.context";

Expand All @@ -15,7 +15,7 @@ import { ChipContent, ChipWrapper } from "./Chip.styles";
import { ChipContext } from "./Chip.context";

export function ChipLeaf<T>(...args: ChipArgs<T>) {
const [props, ref] = useContextPropsV2(ChipContext, args[0], args[1]);
const [props, ref] = useContextProps(ChipContext, args[0], args[1]);

// We're being rendered standalone
if (args.length === 2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
FieldProps,
} from "@components/Fields";
import { useRenderProps } from "@hooks";
import { useContextPropsV2 } from "@hooks/useContextProps";
import { useContextProps } from "@hooks/useContextProps";
import { Provider } from "@components/Internal/Provider";
import { useCollectionRenderer } from "@hooks/useCollectionRenderer";

Expand Down Expand Up @@ -71,9 +71,9 @@ interface ForwardedChipGroupField {

/** Building blocks for constructing a ChipGroup field. */
export const ChipGroupField = forwardRef(function ChipGroupField<
T extends object,
T extends object
>(props: ChipGroupFieldProps, ref: React.ForwardedRef<HTMLDivElement>) {
[props, ref] = useContextPropsV2(ChipGroupFieldContext, props, ref);
[props, ref] = useContextProps(ChipGroupFieldContext, props, ref);

return (
<CollectionBuilder content={props.children}>
Expand Down Expand Up @@ -151,9 +151,9 @@ interface ForwardedChipGroupFieldList {
}

const ChipGroupFieldList = forwardRef(function ChipGroupFieldList<
T extends object,
T extends object
>(props: ChipGroupFieldListProps<T>, ref: React.ForwardedRef<HTMLDivElement>) {
[props, ref] = useContextPropsV2(ChipGroupListContext, props, ref);
[props, ref] = useContextProps(ChipGroupListContext, props, ref);
const state = useContext(ChipGroupStateContext);

// We're building the collection in the ChipGroupField component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
import { createContext } from "react";

export const ChipGroupFieldContext =
createComponentContext<ChipGroupFieldProps<any>>();
createComponentContext<ChipGroupFieldProps>();

export const ChipGroupStateContext = createContext<ListState<any> | null>(null);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useRenderProps } from "@hooks";
import { Provider } from "@components/Internal/Provider";
import { ButtonContext } from "@components/Buttons/Button/Button.context";
import { DEFAULT_SLOT } from "@hooks/useSlottedContext";
import { useContextPropsV2 } from "@hooks/useContextProps";
import { useContextProps } from "@hooks/useContextProps";
import { ErrorMessageContext } from "@components/Fields/Atoms/ErrorMessage";

import { CalendarTitle } from "./components/CalendarTitle";
Expand Down Expand Up @@ -56,8 +56,8 @@ export interface CalendarProps<T extends DateValue>
export function Calendar<T extends DateValue>(props: CalendarProps<T>) {
let ref = useRef(null);
// TS is getting confused because react-aria uses some conditional types that
// it doesn't understand how to resolve when using useContextPropsV2
[props, ref] = useContextPropsV2(CalendarContext as any, props, ref);
// it doesn't understand how to resolve when using useContextProps
[props, ref] = useContextProps(CalendarContext as any, props, ref);

const { size = "medium" } = props;
const { locale } = useLocale();
Expand Down

0 comments on commit 61be30c

Please sign in to comment.