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.

Custom props are not being passed into Field's validate function

See original GitHub issue

Are 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:closed
  • Created 7 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
wlingkecommented, Feb 27, 2017

So should we not expect custom FIELD props to be passed down? Only custom form props?

0reactions
lock[bot]commented, Jul 25, 2018

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

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 >

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