Describe the bug
Getting this warning when using Trans component that is imported from @lingui/macro
Warning: React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
To Reproduce
// ComponentA.tsx
// other imports
import { Trans } from "@lingui/macro";
export default function ComponentA() {
return (
<div><Trans>sample text</Trans></div>
);
}
// ComponentA.test.tsx
// other imports
import ComponentA from "@/components/ComponentA";
jest.mock("@lingui/macro");
describe("Component A", () => {
it("should render without crashing", () => {
shallow(<ComponentA />);
});
});
Expected behavior
Should not get the warning message
Additional context
If I change the import Trans component from @lingui/react the warning is gone
Describe the bug Getting this warning when using
Trans
component that is imported from@lingui/macro
To Reproduce
Expected behavior Should not get the warning message
Additional context If I change the import
Trans
component from@lingui/react
the warning is gone^3.13.2
7.17.8