@comparaonline/ui-forms-review
Review form component
Installation
yarn add @comparaonline/ui-forms-review
Usage
Wrap component into a IntlProvider
and InjectIntlContext
.
import { IntlProvider, addLocaleData } from 'react-intl';
import { InjectIntlContext } from '@comparaonline/react-intl-hooks';
return (
<IntlProvider locale="en" messages={messages}>
<InjectIntlContext>
<ReviewForm {...formProps} />
</InjectIntlContext>
</IntlProvider>
);
Component Props
prop |
required |
type |
description |
fieldTexts |
true |
object |
form field names and labels |
actionProps |
true |
object |
form button texts and click callback |
handleSubmit |
true |
method |
form submit callback |
values |
false |
object |
initial values |
formProps |
false |
method |
FormProps field of react-final-form |
fieldTexts |
required |
type |
description |
rating |
true |
field |
Rating field name and label |
username |
true |
field |
Username field name and label |
email |
true |
field |
Email field name and label |
comment |
true |
field |
Comment field name and label |
actionProps |
required |
type |
description |
submitText |
true |
string |
Submit button text |
secondaryText |
true |
string |
Secondary button text |
onSecondaryClick |
true |
method |
Secondary button click callback |