Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow formsy to be shared with parent through context #249

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

calvinfroedge
Copy link

Hi,

I'm fairly new to React, so I'm not sure if this is the right way to do this or not, but I wanted to be able to share Formsy instances with components that wrap it so I can have multiple levels of abstraction. IE, something like this:

Level 1: AppForm

Level2: FormWrapper

Level3: Formsy

The reason I want to be able to reference formsy in components that wrap it is so I can do things like this:

(note: I would have some trigger on change in the class that contains this logic, so this would get run on re-render)

{this.form.inputs.HasDependencies.hasValue() ? <Input label="Dependency!" type="text" name="dependentOnHasDependencies" /> : ''}

If there is an easier way to do this I would love to know = ) Thanks for your great work on this! I was writing my own and after reading the source code for Formsy decided it was a better option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant