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.

component={renderField} no longer triggers change

See original GitHub issue

I think this may be related to the other issues regarding the new? changes to the onChange handler, but ‘all of a sudden’, the fields on all my forms stopped working.

I’m using the renderField for synchronous validation and if I change the atttribute back to component=“text”, it works fine.

Here is my renderField function:

    const renderField = ({ input, opts, type, placeholder, className, meta: { touched, error } }) => (
        <div>
          <input {...input} {...opts} type={type} placeholder={placeholder} className={className}/>
          {touched && ( error && <span className="gt-error"><i className="fa fa-exclamation-circle" /> {error}</span>)}
        </div>
    );

And I call it with:

<Field opts={opts} name={props.controlId} component={renderField} type={type} className="form-control" placeholder={props.placeholder}/>

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
MrRoycecommented, Jan 16, 2017

The problem was I had renderField defined as a constant inside a generic reusable ‘Text’ component. When I moved the renderField out of the component. It works fine. Closing.

0reactions
lock[bot]commented, Apr 29, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

useEffect not getting trigger after state change - Stack Overflow
I'm making a custom dropdown, that allows for pushing new items in the dropdown. For some reason the useEffect is not being triggered...
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