Closed alexcarpenter closed 3 months ago
Latest commit: e6be4dba708843789114f8e7142f53018ac81213
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Description
translateError
export frommakeLocalizeable
utilenUS default:
esMX example:
Future thought I noodled on, baking some of the logic into these common components with escape hatches.
EmailField example
```tsx import * as Common from '@clerk/elements/common'; import React from 'react'; import { useAttributes } from '~/hooks/use-attributes'; import { useLocalizations } from '~/hooks/use-localizations'; import * as Field from '../primitives/field'; const FIELD_NAME = 'emailAddress'; const ERROR_NAME = 'email_address'; export function EmailField({ alternativeFieldTrigger, label, name = FIELD_NAME, hintText, error, ...props }: { alternativeFieldTrigger?: React.ReactNode; label?: React.ReactNode; hintText?: string; error?: (message: string, code: string, name: string) => string; } & Omithttps://linear.app/clerk/issue/SDKI-68/localization-implement-translateerror-util
Checklist
npm test
runs as expected.npm run build
runs as expected.Type of change