3.2.3 • Published 6 years ago
@alexseitsinger/react-simple-form v3.2.3
SimpleForm
A simple form for simple inputs.
Installation
yarn add @alexseitsinger/react-simple-formExample
function App(props){
  return (
    <SimpleForm
      isFormSubmitted={props.isFormSubmitted}
      setFormSubmitted={props.setFormSubmitted}
      onFormSubmitted={props.onFormSubmitted}
      onFormCompleted={props.onFormCompleted}>
      <SimpleInput 
        resetValue={""}
        inputType={"text"}
        inputName={"name"}
        inputPlaceholder={"Name..."}
        minLength={8}
        maxLength={24}
        onSanitize={value => {
          // Do some cleaning...
          return value
        }}
        onDidSanitize={(oldValue, newValue) => {
          // Do something each time there's a cleaning...
        }}
        isInputEmpty={props.isNameFieldEmpty}
        setInputEmpty={props.setNameFieldEmpty}
        inputValue={props.nameFieldValue}
        setInputValue={props.setNameFieldValue}
        isValueValid={props.isNameFieldValueValid}
        setValueValid={props.setNameFieldValueValid}
        errorMessage={props.nameFieldErrorMessage}
        setErrorMessage={props.setNameFieldErrorMessage}
        errorStyle={{
          //...
        }}
        errorPosition={"centerLeft"}
      />
    </SimpleForm>
  )
}