-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update prettier config and clean up (#39)
- Removed `singleQuote` field from the Prettier configuration. - Removed `useTabs` field from the Prettier configuration.
- Loading branch information
1 parent
12ec140
commit cd4c1d1
Showing
18 changed files
with
362 additions
and
366 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
import { type ReactNode, Children, isValidElement, cloneElement, ComponentProps } from "react" | ||
|
||
export const Slot = ({ children, ...props }: { children: React.ReactNode }) => { | ||
if (isValidElement(children)) { | ||
return cloneElement(children, { ...props, ...children.props }) | ||
} | ||
if (Children.count(children) > 1) { | ||
Children.only(null) | ||
} | ||
return null | ||
if (isValidElement(children)) { | ||
return cloneElement(children, { ...props, ...children.props }) | ||
} | ||
if (Children.count(children) > 1) { | ||
Children.only(null) | ||
} | ||
return null | ||
} | ||
|
||
export type SlotWithAsChild< | ||
Component extends keyof React.JSX.IntrinsicElements | React.JSXElementConstructor<unknown>, | ||
Component extends keyof React.JSX.IntrinsicElements | React.JSXElementConstructor<unknown>, | ||
> = ({ asChild?: false } & ComponentProps<Component>) | { asChild: true; children: ReactNode } | ||
|
||
export type SlotProps<Component extends keyof React.JSX.IntrinsicElements | React.JSXElementConstructor<unknown>> = | ||
SlotWithAsChild<Component> & { className?: string } | ||
SlotWithAsChild<Component> & { className?: string } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.