Custom props are not being passed into Field's validate function
See original GitHub issueAre you submitting a bug report or a feature request?
Bug report
What is the current behavior?
If I pass a custom prop into a <Field component={Component} custom={custom} validate={validate}/>
const validate = (value, values, props) => console.log(props.custom) //undefined
What is the expected behavior?
I expected all props to be available in validate.
What’s your environment?
redux form 6.5.0
Issue Analytics
- State:
- Created 7 years ago
- Comments:10
Top Results From Across the Web
Custom props are not being passed into Field's validate function
If I pass a custom prop into a const validate = (value, values, ... Custom props are not being passed into Field's validate...
Read more >How to pass custom props to validate function in redux-form?
I came across this Scenario where I needed values from state and validate the redux form data with them. Solution that I implemented...
Read more >How to validate React props using PropTypes - LogRocket Blog
Learn how to validate props with React PropTypes, React's internal mechanism for adding type checking to component props.
Read more >Final Form Docs – `FieldProps`
A render function that is given FieldRenderProps , as well as any non-API props passed into the <Field/> component. For example, if you...
Read more >Field - Redux Form
Allows you to to provide a field-level validation rule. The function is given the fields current value, all other form values, the props...
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
So should we not expect custom FIELD props to be passed down? Only custom form props?
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.