From 422db60a1d209900c217cad3f0735d7029ca7eaa Mon Sep 17 00:00:00 2001 From: VickyStash Date: Wed, 6 Mar 2024 10:06:17 +0100 Subject: [PATCH] Rename args to props --- src/stories/InlineSystemMessage.stories.tsx | 4 ++-- src/stories/MagicCodeInput.stories.tsx | 4 ++-- src/stories/Picker.stories.tsx | 4 ++-- src/stories/TextInput.stories.tsx | 18 +++++++++--------- src/stories/Tooltip.stories.tsx | 6 +++--- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/stories/InlineSystemMessage.stories.tsx b/src/stories/InlineSystemMessage.stories.tsx index 32271a394ae8..5c00a41ac479 100644 --- a/src/stories/InlineSystemMessage.stories.tsx +++ b/src/stories/InlineSystemMessage.stories.tsx @@ -15,9 +15,9 @@ const story: ComponentMeta = { component: InlineSystemMessage, }; -function Template(args: InlineSystemMessageProps) { +function Template(props: InlineSystemMessageProps) { // eslint-disable-next-line react/jsx-props-no-spreading - return ; + return ; } // Arguments can be passed to the component by binding diff --git a/src/stories/MagicCodeInput.stories.tsx b/src/stories/MagicCodeInput.stories.tsx index 4ebab6e868ae..bb86c1685593 100644 --- a/src/stories/MagicCodeInput.stories.tsx +++ b/src/stories/MagicCodeInput.stories.tsx @@ -15,14 +15,14 @@ const story: ComponentMeta = { component: MagicCodeInput, }; -function Template(args: MagicCodeInputProps) { +function Template(props: MagicCodeInputProps) { const [value, setValue] = useState(''); return ( ); } diff --git a/src/stories/Picker.stories.tsx b/src/stories/Picker.stories.tsx index b13d28cf77ac..a277db387f79 100644 --- a/src/stories/Picker.stories.tsx +++ b/src/stories/Picker.stories.tsx @@ -17,14 +17,14 @@ const story: ComponentMeta = { component: Picker, }; -function Template(args: TemplateProps) { +function Template(props: TemplateProps) { const [value, setValue] = useState(''); return ( setValue(e)} // eslint-disable-next-line react/jsx-props-no-spreading - {...args} + {...props} /> ); } diff --git a/src/stories/TextInput.stories.tsx b/src/stories/TextInput.stories.tsx index 5250b69a4389..b8e647949c0f 100644 --- a/src/stories/TextInput.stories.tsx +++ b/src/stories/TextInput.stories.tsx @@ -15,9 +15,9 @@ const story: ComponentMeta = { component: TextInput, }; -function Template(args: BaseTextInputProps) { +function Template(props: BaseTextInputProps) { // eslint-disable-next-line react/jsx-props-no-spreading - return ; + return ; } // Arguments can be passed to the component by binding @@ -80,12 +80,12 @@ MaxLengthInput.args = { maxLength: 50, }; -function HintAndErrorInput(args: BaseTextInputProps) { +function HintAndErrorInput(props: BaseTextInputProps) { const [error, setError] = useState(''); return ( { if (value && value.toLowerCase() === 'oops!') { setError("Oops! Looks like there's an error"); @@ -105,16 +105,16 @@ HintAndErrorInput.args = { }; // To use autoGrow we need to control the TextInput's value -function AutoGrowSupportInput(args: BaseTextInputProps) { - const [value, setValue] = useState(args.value ?? ''); +function AutoGrowSupportInput(props: BaseTextInputProps) { + const [value, setValue] = useState(props.value ?? ''); React.useEffect(() => { - setValue(args.value ?? ''); - }, [args.value]); + setValue(props.value ?? ''); + }, [props.value]); return ( diff --git a/src/stories/Tooltip.stories.tsx b/src/stories/Tooltip.stories.tsx index 381c4f510616..c9caf7bc6496 100644 --- a/src/stories/Tooltip.stories.tsx +++ b/src/stories/Tooltip.stories.tsx @@ -15,15 +15,15 @@ const story: ComponentMeta = { component: Tooltip, }; -function Template(args: TooltipExtendedProps) { +function Template(props: TooltipExtendedProps) { return (