A light-weight react form component
- fields: array - array of configurations for input fields in your form. (required)
- buttons: array - array of configurations for button fields in your form. (required)
- url: string - the url you want your form to post or get. (default to '#')
- method: string - the method you want your form to apply. (default to 'POST')
{
fields: PropTypes.arrayOf(PropTypes.shape({
fieldName: PropTypes.string.isRequired,
displayName: PropTypes.string.isRequired,
type: PropTypes.string,
})),
buttons: PropTypes.arrayOf(PropTypes.shape({
text: PropTypes.string.isRequired,
type: PropTypes.string,
redirect: PropTypes.string,
onClick: PropTypes.func,
})),
url: PropTypes.string,
method: PropTypes.oneOf(['GET', 'POST']),
}