Skip to content

Suspected false positives in v0.4.26 #100

@baraknaveh

Description

@baraknaveh

I'm getting:
Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components.

in this example:

import { cn } from "@/lib/utils";

// Exported for drop area, MenuButton
export const ACTION_BUTTON_STYLE =  ///// <--  flagged with error
  "flex rounded-full py-2 px-3 items-center justify-center";
export const ACTION_BUTTON_PRIMARY_STYLE = cn(
  /* normal.. */ "bg-zinc-900 text-white",
  /* hover... */ "hover:bg-zinc-700",
  /* active.. */ "active:bg-zinc-500",
  /* disabled */ "disabled:bg-zinc-100 disabled:text-zinc-400",
);

where @/lib/utils.ts is:

import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";

export function cn(...inputs: ClassValue[]) {
  return twMerge(clsx(inputs));
}

Why am I getting the report? is this not a false positive?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions