Skip to content

False positive on useTranslations() from next-intl #9

Closed
@HowManyOliversAreThere

Description

@HowManyOliversAreThere

When using the line const t = useTranslations(); (from next-intl) in a Next.js React component, it falsely triggers the react-server-components/use-client rule. At a guess I would assume this to be because useTranslations() support both server and client side rendering and as such the inspection may be falsely flagging something inside of it.

In the short term we are going to just individually prefix all of our useTranslations lines with // eslint-disable-next-line react-server-components/use-client lines above them, but this is unwieldy and would prefer to be avoided. It would be good if this false positive can be fixed, or if we could configure some global pattern for lines that can be ignored by this rule.

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