Skip to content

Commit 744102b

Browse files
ompharatejoshblack
andauthored
fix: made textInput extra props optional (#6341)
Co-authored-by: Josh Black <[email protected]>
1 parent 60713cf commit 744102b

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed

.changeset/proud-steaks-bake.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/react": patch
3+
---
4+
5+
Update TextInput TypeScript types to make shared props optional

packages/react/src/TextInput/TextInput.tsx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,21 @@ export type TextInputNonPassthroughProps = {
3939
* A visual that renders inside the input after the typing area
4040
*/
4141
trailingAction?: React.ReactElement<React.HTMLProps<HTMLButtonElement>>
42-
} & Pick<
43-
StyledWrapperProps,
44-
| 'block'
45-
| 'contrast'
46-
| 'disabled'
47-
| 'monospace'
48-
| 'sx'
49-
| 'width'
50-
| 'maxWidth'
51-
| 'minWidth'
52-
| 'variant'
53-
| 'size'
54-
| 'validationStatus'
42+
} & Partial<
43+
Pick<
44+
StyledWrapperProps,
45+
| 'block'
46+
| 'contrast'
47+
| 'disabled'
48+
| 'monospace'
49+
| 'sx'
50+
| 'width'
51+
| 'maxWidth'
52+
| 'minWidth'
53+
| 'variant'
54+
| 'size'
55+
| 'validationStatus'
56+
>
5557
>
5658

5759
export type TextInputProps = Merge<React.ComponentPropsWithoutRef<'input'>, TextInputNonPassthroughProps>

0 commit comments

Comments
 (0)