Validate child against parent.
See original GitHub issueHi,
I’m having a hard time figuring this out, not sure if it’s even supported but I feel like it should be.
Basically I’m trying to mark a field as required if a referenced field is truthy. Something along the lines of
{
requiredField: boolean(),
nested: object().shape({
conditional: when('$parent.requiredField', ....)
})
}
Something similar was being discussed over at https://github.com/jaredpalmer/formik/issues/539 but that convo didn’t get very far.
Is there no way to reference a key in a parent schema?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:27
- Comments:22 (1 by maintainers)
Top Results From Across the Web
Why It Is So Important For Parents to Validate Their Children
Validation is a way of letting someone know we understand him or her. Being understood is an essential ingredient to feeling connected and...
Read more >Emotional Validation: How to Validate a Child's Feelings (33 ...
Validation can be used with a child who is showing negative emotions. It's also one of the most effective ways to calm down...
Read more >Validating Your Child's Feelings: the How's and Why's
Emotional validation teaches your kids that feeling and expressing their emotions is OK. Parents who validate their kids' emotions model that it's natural...
Read more >5 Simple Statements to Validate Your Child's Feelings
Parental validation doesn't condone poor behavior; rather, it helps a child to feel seen, heard, and valued. · It also serves to deescalate ......
Read more >Parenting With Validation - Kurtz Psychology
Validation encourages children to share their feelings and encourages open communication about emotions. Through validation, a parent can teach ...
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
We had a similar issue, but solved it this way:
I ended up passing in the entire object that I’m trying to validate as context so I could grab the values I care about.