From c41ff65030050111e9ab65288ce6793fa515fa0a Mon Sep 17 00:00:00 2001 From: Marco Ciampini Date: Fri, 9 Aug 2024 11:39:25 +0200 Subject: [PATCH] Mark `store` prop on `Composite` as required --- packages/components/src/composite/README.md | 12 ++++++------ .../components/src/composite/stories/index.story.tsx | 2 +- packages/components/src/composite/types.ts | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/components/src/composite/README.md b/packages/components/src/composite/README.md index 03c7e2fca7772a..59953f1273a054 100644 --- a/packages/components/src/composite/README.md +++ b/packages/components/src/composite/README.md @@ -93,6 +93,12 @@ Renders a composite widget. #### Props +##### `store`: `CompositeStore` + +Object returned by the `useCompositeStore` hook. + +- Required: yes + ##### `render`: `RenderProp & { ref?: React.Ref | undefined; }> | React.ReactElement>` Allows the component to be rendered as a different HTML element or React component. The value can be a React element or a function that takes in the original component props and gives back a React element with the props merged. @@ -105,12 +111,6 @@ The contents of the component. - Required: no -##### `store`: `CompositeStore` - -Object returned by the `useCompositeStore` hook. - -- Required: no - ### `Composite.Group` Renders a group element for composite items. diff --git a/packages/components/src/composite/stories/index.story.tsx b/packages/components/src/composite/stories/index.story.tsx index 3fe84f2e315359..b143c1f7db05f7 100644 --- a/packages/components/src/composite/stories/index.story.tsx +++ b/packages/components/src/composite/stories/index.story.tsx @@ -45,7 +45,6 @@ const meta: Meta< typeof UseCompositeStorePlaceholder > = { 'RenderProp & { ref?: React.Ref | undefined; }> | React.ReactElement>', }, }, - // type: { required: true }, }, children: { name: 'children', @@ -171,6 +170,7 @@ const meta: Meta< typeof UseCompositeStorePlaceholder > = { 'CompositeStore', }, }, + type: { required: true }, }, }, 'Composite.Group': commonArgTypes, diff --git a/packages/components/src/composite/types.ts b/packages/components/src/composite/types.ts index 04c15e67688123..438d1caaa94f8a 100644 --- a/packages/components/src/composite/types.ts +++ b/packages/components/src/composite/types.ts @@ -23,7 +23,7 @@ export type CompositeProps = Pick< /** * Object returned by the `useCompositeStore` hook. */ - store?: Ariakit.CompositeStore; + store: Ariakit.CompositeStore; }; export type CompositeGroupProps = Pick<