Skip to content

Commit

Permalink
chore: deprecate isTranslated prop (#1772)
Browse files Browse the repository at this point in the history
  • Loading branch information
vonovak committed Sep 27, 2023
1 parent 79e7a03 commit d6501e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 4 additions & 0 deletions packages/react/src/TransNoContext.tsx
Expand Up @@ -9,6 +9,9 @@ export type TransRenderProps = {
translation: React.ReactNode
children: React.ReactNode
message?: string | null
/**
* @deprecated isTranslated prop is undocumented and buggy. It'll be removed in v5 release.
* */
isTranslated: boolean
}

Expand Down Expand Up @@ -107,6 +110,7 @@ export function TransNoContext(
id,
message,
translation,
// TODO vonovak - remove isTranslated prop in v5 release
isTranslated: id !== translation && message !== translation,
children: translation, // for type-compatibility with `component` prop
}
Expand Down
4 changes: 1 addition & 3 deletions website/docs/ref/react.md
Expand Up @@ -94,9 +94,7 @@ i18n.load({
});
i18n.activate("en");

const DefaultI18n = ({ isTranslated, children }) => (
<span style={{ color: isTranslated ? undefined : "red" }}>{children}</span>
);
const DefaultI18n = ({ children }) => <span>{children}</span>;

const App = () => {
return (
Expand Down

1 comment on commit d6501e3

@vercel
Copy link

@vercel vercel bot commented on d6501e3 Sep 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.