Skip to content

Commit

Permalink
Fix for is prop collisions. (#60)
Browse files Browse the repository at this point in the history
* Fix for `is` prop collisions.

* add changeset

* Update docs.
  • Loading branch information
nsaunders authored Jul 6, 2024
1 parent 4c18c0e commit f88ed60
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/seven-books-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@embellish/react": patch
---

Fixed a potential \`is\` prop collision issue.
8 changes: 4 additions & 4 deletions docs/api/react.componentprops.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ P,
C extends string,
Is extends keyof JSX.IntrinsicElements | React.JSXElementConstructor<any>,
InlineConditionName extends string,
OwnProps = (string extends C
OwnProps = {
is?: Is;
} & (string extends C
? unknown
: {
conditions?: {
Expand All @@ -35,9 +37,7 @@ Partial<{
? P[PropName]
: never;
}>,
> = {
is?: Is;
} & Omit<
> = Omit<
JSX.LibraryManagedAttributes<Is, ComponentPropsWithRef<Is>>,
keyof OwnProps
> &
Expand Down
8 changes: 4 additions & 4 deletions packages/react/src/component.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ export type ComponentProps<
C extends string,
Is extends keyof JSX.IntrinsicElements | React.JSXElementConstructor<any>,
InlineConditionName extends string,
OwnProps = (string extends C
OwnProps = {
is?: Is;
} & (string extends C
? unknown
: {
conditions?: {
Expand All @@ -82,9 +84,7 @@ export type ComponentProps<
? P[PropName]
: never;
}>,
> = {
is?: Is;
} & Omit<
> = Omit<
JSX.LibraryManagedAttributes<Is, ComponentPropsWithRef<Is>>,
keyof OwnProps
> &
Expand Down

0 comments on commit f88ed60

Please sign in to comment.