component={renderField} no longer triggers change
See original GitHub issueI 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:
- Created 7 years ago
- Comments:7 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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.