Skip to content

Access yup resolver context? #9084

Answered by leapful
Notaduck asked this question in Q&A
Sep 23, 2022 · 3 comments · 3 replies
Discussion options

You must be logged in to vote

@Notaduck @bluebill1049 :

As I remember, context will be provided via useForm({ context: { // Some context props } }), not from resolver schema options 😄

The current implementation of yup resolver is using Object.assign({}, schemaOptions, { context // this is the context from react-hook-form }) therefore the react-hook-form context always overrides the "context" from schemaOptions.

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@bluebill1049
Comment options

@Notaduck
Comment options

Answer selected by bluebill1049
Comment options

You must be logged in to vote
1 reply
@Athelian
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants