Skip to content

Commit

Permalink
Apply same fix to the top level Composite too
Browse files Browse the repository at this point in the history
  • Loading branch information
ciampo committed Oct 2, 2024
1 parent 5bc6dfb commit 41ab175
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/components/src/composite/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ export const Composite = Object.assign(
},
ref
) {
const store = Ariakit.useCompositeStore( {
// @ts-expect-error The store prop is undocumented and only used by the
// legacy compat layer.
const storeProp = props.store as Ariakit.CompositeStore;
const internalStore = Ariakit.useCompositeStore( {
activeId,
defaultActiveId,
setActiveId,
Expand All @@ -85,6 +88,8 @@ export const Composite = Object.assign(
rtl,
} );

const store = storeProp ?? internalStore;

const contextValue = useMemo(
() => ( {
store,
Expand Down

0 comments on commit 41ab175

Please sign in to comment.