question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Redux-form semantic UI with AsyncValidation

See original GitHub issue

Need help

I followed this example http://redux-form.com/6.6.3/examples/submitValidation/ and http://redux-form.com/6.6.3/examples/asyncValidation/

I use Semanitic-UI & made a loading state Redux-form component as code below:

Loading state of the semantic Input is: <Input loading icon='user' placeholder='Whatever...' /> You could find it here

And the render Field component is:

...
const ReduxFormInput = ({ input, label, placeholder, checkboxLabel, type, meta: { asyncValidate, touched, error } }) => {
  const errorMessage = (<div style={{ color: '#E20000', paddingTop: '.3rem', fontSize: '12px' }} >
    <Icon name="warning" />
    {error}
  </div>);

  return (
    <div>
      <Label>{label}</Label>
      <Input
        {...input}
        type={type}
        placeholder={placeholder}
        error={error ? true : null}
        loading={asyncValidate ? true : undefined} // load loading state when submitting 
        icon={asyncValidate ? 'user' : undefined} // load icon state when submitting
      />
      {touched && error && errorMessage}
    </div>
  );
};

export default ReduxFormInput;

The form work perfectly instead of Async Loading state within semantic-ui component.

My expect is the icon loading when submitting form

Thank you so much.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
vitbokischcommented, May 2, 2017

@viiiprock you are welcome, btw console.log() will help you to understand what props are passed 😉

1reaction
vitbokischcommented, May 2, 2017

@viiiprock const ReduxFormInput = ({ input, label, placeholder, checkboxLabel, type, meta: { submitting, asyncValidate, touched, error } }) => ...

<Input
  {...input}
  type={type}
  placeholder={placeholder}
  error={error ? true : null}
  loading={submitting|| asyncValidate ? true : undefined} // ---> semantic-ui-react loading prop, state when submitting 
  icon={submitting|| asyncValidate ? 'user' : undefined} // ---> semantic-ui-react icon prop, load icon when submitting
/>

What about like this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Redux-form semantic UI with AsyncValidation - Stack Overflow
Ok, I found my answer const ReduxFormInput = ({ input, label, placeholder, checkboxLabel, type, meta: { submitting, asyncValidate, touched, error } }) =>...
Read more >
Redux-form semantic UI with AsyncValidation · Issue #2869 - GitHub
Need help I followed this example http://redux-form.com/6.6.3/examples/submitValidation/ and http://redux-form.com/6.6.3/examples/asyncValidation/ I use ...
Read more >
Material UI Example - Redux Form
For Material UI, @erikras has published a set of wrapper components to use Material UI: redux-form-material-ui . How to use async validation in...
Read more >
semantic-ui-react-with-redux-form - CodeSandbox
CodeSandbox is an online editor tailored for web applications.
Read more >
Is it possible to save redux-form data by UUID? - Stack Overflow
Can't find any examples on https://redux-form.com form: { [uuid1]: { form1 form2 . ... Redux-form semantic UI with AsyncValidation.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found