Creation:2026-01-21Last update:2026-01-21
Reference this doc to your favorite AI assistantChatGPTClaudeDeepSeekGoogle AI modeGeminiPerplexityMistralGrok
Ask your question and get a summary of the document by referencing this page and the AI provider of your choice
Version History
- "Unified documentation for all exports"v7.5.141/21/2026
Edit this doc
If you have an idea for improving this documentation, please feel free to contribute by submitting a pull request on GitHub.
GitHub link to the documentationCopy
Copy doc Markdown to clipboard
useIntlayer Hook Documentation
The useIntlayer hook allows you to retrieve localized content from a dictionary using its key. It is based on useDictionary but automatically injects an optimized version of the dictionary from the generated declarations.
Usage
tsx
Copy code
Copy the code to the clipboard
import { useIntlayer } from "react-intlayer";const MyComponent = () => { const content = useIntlayer("my-dictionary-key"); return ( <div> <h1>{content.title}</h1> <p>{content.description}</p> </div> );};Description
The hook performing the following tasks:
- Locale Detection: It uses the current locale from the
IntlayerProvidercontext. - Dictionary Injection: it automatically injects the content of the dictionary corresponding to the provided key, using the optimized declarations generated by the Intlayer compiler.
- Translation Processing: it resolves the content based on the detected locale, processing any
t(),enu(), etc., definitions found within the dictionary.