[material-ui][Box] Unsafe assignment of an any
value error when using i18next t function in aria-label of Box component
#41180
Labels
component: Box
The React component.
external dependency
Blocked by external dependency, we can’t do anything about it
Steps to reproduce
Set up a project using @mui/material, react-i18next, eslint and typescript. Set up the project according to the context section.
Create this component:
Current behavior
I get a
@typescript-eslint/no-unsafe-assignment
eslint error at thet
at<Box aria-label={t("description_expand")}>
<Box aria-label={t("description_expand") as string}>
doesn't work ether but<Box aria-label={`${t("description_expand")}`}>
works.Doing this works as well:
Using a different Mui component or a div works:
<div aria-label={t("description_expand")}>
Expected behavior
The aria-label of Box should work like the one of the other components or elements.
Context
The project really isn't something special.
Your environment
npx @mui/envinfo
My .eslintrc
And my tsconfig:
And tsconfig.node.json:
Search keywords: i18next aria-label eslint typescript
The text was updated successfully, but these errors were encountered: