I’m working on a React project where I need to change the default error message for a HubSpot form. The form is working fine but I want to customize the validation message that shows up when users enter invalid email addresses.
Here’s my current setup:
<HubSpotContactForm
accountId="123456"
targetFormId="abc-def-ghi-123-456"
onFormSubmit={() => console.log('submitted')}
onFormLoad={() => this.setupEventHandlers()}
loadingComponent={<span>Please wait...</span>}
styling={customStyles}
formClassName="contact-form"
/>
I found some documentation about customizing error messages using internationalization settings. I tried adding these props:
language="en"
messageOverrides={
en: {
invalidBusinessEmail: "Use your work email instead"
}
}
But I keep getting a compilation error saying the locale property is undefined. Has anyone successfully customized HubSpot form error messages in React? What am I missing here?
Any help would be great!