What problem does it solve?
Locale strings that contain markup (like '<Red>{{keyword}}</Red>') need the <Translate> component, but defining the components map inline during render creates new component identities every render, causing React to unmount and remount subtrees and lose state, DOM, and focus.
Core Features & Use Cases
- Stable components map patterns: Shows how to map locale tags to intrinsic HTML strings, hoisted module-scope components, or components receiving data via componentProps.
- Lint rule alignment: Explains the @repo/i18n/no-inline-translate-components oxlint rule and why useMemo or factory calls do not fix the identity problem.
- Gotcha coverage: Documents TypeScript generic widening in componentProps, children behavior for wrapping vs self-closing tags, and RECOGNIZED_HTML_TAGS fallback behavior.
- Use Case: When adding a search UI message like 'Search for "<Emphasis>{{keyword}}</Emphasis>"', use this Skill to write a compliant <Translate> usage that passes review and lint.
Quick Start
Ask the assistant to review or write a <Translate> usage for a locale string containing markup, following the hoisted-components and componentProps patterns.