Skip to content

Commit

Permalink
docs: wording in react-patterns.md (#1779)
Browse files Browse the repository at this point in the history
  • Loading branch information
vonovak authored Oct 6, 2023
1 parent 5cfa605 commit 0495209
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions website/docs/tutorials/react-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ function MyComponent() {
:::

:::note
The all js macros such as [`t`](/docs/ref/macro.md#t) [`plural`](/docs/ref/macro.md#plural), [`select`](/docs/ref/macro.md#select), [`selectOrdinal`](/docs/ref/macro.md#selectordinal) cannot be used on the module level.
All js macros such as [`t`](/docs/ref/macro.md#t) [`plural`](/docs/ref/macro.md#plural), [`select`](/docs/ref/macro.md#select), [`selectOrdinal`](/docs/ref/macro.md#selectordinal) cannot be used on the module level.

```jsx
import { t } from "@lingui/macro";

// ❌ Bad! This won't work because the `t` macro is used at the module level.
// The `t` macro returns a string, and once this string is assigned, it won't react to changes.
// The `t` macro returns a string, and once this string is assigned, it won't react to locale changes.
const colors = [t`Red`, t`Orange`, t`Yellow`, t`Green`];

// ✅ Good! Every time the function is executed, the `t` macro will be re-executed as well,
Expand Down

1 comment on commit 0495209

@vercel
Copy link

@vercel vercel bot commented on 0495209 Oct 6, 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.