Skip to content

Commit 2ca0253

Browse files
committed
improve optionText prop type in stories
1 parent e6a41a6 commit 2ca0253

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

packages/ra-ui-materialui/src/input/AutocompleteInput.stories.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,9 @@ export const CreateDialog = () => (
486486
</Wrapper>
487487
);
488488

489-
const CreateLabelInput = ({ optionText }) => {
489+
const CreateLabelInput = ({
490+
optionText,
491+
}: Pick<AutocompleteInputProps, 'optionText'>) => {
490492
const [choices, setChoices] = useState(choicesForCreationSupport);
491493
return (
492494
<AutocompleteInput
@@ -523,7 +525,9 @@ const CreateLabelInput = ({ optionText }) => {
523525
);
524526
};
525527

526-
export const CreateLabel = ({ optionText }: any) => (
528+
export const CreateLabel = ({
529+
optionText,
530+
}: Pick<AutocompleteInputProps, 'optionText'>) => (
527531
<Wrapper>
528532
<CreateLabelInput optionText={optionText} />
529533
</Wrapper>

packages/ra-ui-materialui/src/input/SelectInput.stories.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313

1414
import { Create as RaCreate, Edit } from '../detail';
1515
import { SimpleForm } from '../form';
16-
import { SelectInput } from './SelectInput';
16+
import { SelectInput, SelectInputProps } from './SelectInput';
1717
import { TextInput } from './TextInput';
1818
import { ReferenceInput } from './ReferenceInput';
1919
import { SaveButton } from '../button/SaveButton';
@@ -321,7 +321,9 @@ export const OnCreate = () => {
321321
);
322322
};
323323

324-
export const CreateLabel = ({ optionText }: any) => {
324+
export const CreateLabel = ({
325+
optionText,
326+
}: Pick<SelectInputProps, 'optionText'>) => {
325327
const categories: Partial<{
326328
id: string;
327329
name: string;

0 commit comments

Comments
 (0)