You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In contrast, these are examples of patterns that are **not supported**:
320
+
321
+
```tsx
322
+
import {useExtracted} from'next-intl';
323
+
324
+
function Example({key}) {
325
+
const t =useExtracted();
326
+
327
+
// β `key` is only known at runtime
328
+
t(key);
329
+
330
+
// β Passing `t` to another function
331
+
getName(t);
332
+
}
333
+
334
+
// β Re-exporting the hook
335
+
exportconst useExtractedExport =useExtracted;
336
+
```
337
+
285
338
## Monorepos and external packages [#monorepos-external-packages]
286
339
287
340
Whenever your app pulls in external modules that call `useExtracted`, whether it's a sibling package in your monorepo or a reusable library installed in `node_modules`, there are two typical setups you can choose from.
@@ -401,56 +454,3 @@ const messages = {
401
454
To avoid key collisions between packages, you can consider using [namespaces](#namespaces).
402
455
403
456
</Callout>
404
-
405
-
## Static analysis [#static-analysis]
406
-
407
-
Message extraction relies on [static analysis](https://en.wikipedia.org/wiki/Static_program_analysis).
408
-
409
-
In practice, this means:
410
-
411
-
1.`t` must receive a literal string as its message argument
412
-
2.`t` must be called in the same function body where it was retrieved from `useExtracted` or `getExtracted`
0 commit comments