Skip to content

Commit

Permalink
Removed deprecated default props declarations on UI components
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianLeChat committed Jan 1, 2025
1 parent 566baaf commit 4af9fd5
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 19 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"files": ["**/components/ui/*.tsx", "**/utilities/env.ts"],
"rules": {
"react/prop-types": "off",
"react/require-default-props": "off",
"@typescript-eslint/no-empty-object-type": "off"
}
}
Expand Down
4 changes: 0 additions & 4 deletions app/[locale]/components/ui/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ const Button = forwardRef<HTMLButtonElement, ButtonProps>(
}
);

Button.defaultProps = {
asChild: false
};

Button.displayName = "Button";

export { Button, buttonVariants };
14 changes: 1 addition & 13 deletions app/[locale]/components/ui/dropdown-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ const DropdownMenuSubTrigger = forwardRef<
</DropdownMenuPrimitive.SubTrigger>
) );

DropdownMenuSubTrigger.defaultProps = {
inset: false
};

DropdownMenuSubTrigger.displayName =
DropdownMenuPrimitive.SubTrigger.displayName;

Expand Down Expand Up @@ -97,10 +93,6 @@ const DropdownMenuItem = forwardRef<
/>
) );

DropdownMenuItem.defaultProps = {
inset: false
};

DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;

const DropdownMenuCheckboxItem = forwardRef<
Expand Down Expand Up @@ -168,10 +160,6 @@ const DropdownMenuLabel = forwardRef<
/>
) );

DropdownMenuLabel.defaultProps = {
inset: false
};

DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;

const DropdownMenuSeparator = forwardRef<
Expand All @@ -190,7 +178,7 @@ DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
function DropdownMenuShortcut( {
className,
...props
}: HTMLAttributes<HTMLSpanElement> )
}: Readonly<HTMLAttributes<HTMLSpanElement>> )
{
return (
<span
Expand Down
2 changes: 1 addition & 1 deletion app/[locale]/components/ui/progress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const Progress = forwardRef<
>
<ProgressPrimitive.Indicator
className="size-full flex-1 bg-primary transition-all"
style={{ transform: `translateX(-${ 100 - ( value || 0 ) }%)` }}
style={{ transform: `translateX(-${ 100 - ( value ?? 0 ) }%)` }}
/>
</ProgressPrimitive.Root>
) );
Expand Down
3 changes: 2 additions & 1 deletion config/routes.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
//
// Déclaration des routes vers les différentes pages des paramètres.
//
import type { ReactNode } from "react";
import { Bug, Bell, User, Cctv, Files, Palette } from "lucide-react";

export const routes: {
id: string;
icon: JSX.Element;
icon: ReactNode;
href: string;
}[] = [
{
Expand Down

0 comments on commit 4af9fd5

Please sign in to comment.