Skip to content

useTranslations type mismatch - Expected 0 arguments #2314

@emmaielle

Description

@emmaielle

useTranslations Type Mismatch - Expected 0 arguments, but got X

I'm following the set up and everything's working on the browser, but I see a type issue every time that I call the useTranslations t function:

Image

To Reproduce

import { useTranslation } from 'next-i18next';

export const Component = ({ appName }: Props) => {
    const { t } = useTranslation('common');

   ...
   return (
       <h1>{t('do-more.title', { appName })}</h1>
   )
}

Expected behavior

Not sure why it's expecting 0 arguments. It follows the basic way to call for a translation AND it's working.

fyi, I nuked all node_modules and reinstalled everything again in case it was a confusion with versions. Let me know what other type of context I can provide.

Your Environment

runtime version: i.e. browser, nextJS
os: Mac

{
   "i18next": "^22.2.2",
    "next": "^14.1.3",
    "next-i18next": "^15.14.1",
    "react-i18next": "^15.14.0"
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions