Using useLingui
hook together with useLingui
macro?
#2118
-
I have a small component like so: import { msg } from "@lingui/core/macro";
import { useLingui } from "@lingui/react";
import { otherMessageDescriptor } from "somewhere";
const Component= () => {
const { _ } = useLingui();
return (
<>
<div>{_(msg`Locally defined string`)}</div>
<div>{_(otherMessageDescriptor)}</div>
</>);
}; Now, if I wanted to use the new
But then how should I handle the legitimate use case for the regular Can the hook and macro even be combined? |
Beta Was this translation helpful? Give feedback.
Answered by
timofei-iatsenko
Dec 10, 2024
Replies: 1 comment 4 replies
-
use useLingui macro in both cases. Simply replace useLingui runtime with macro version |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, it's the same.