Skip to content

Allow formsy to be shared with parent through context#249

Open
calvinfroedge wants to merge 1 commit into
christianalfoni:masterfrom
calvinfroedge:master
Open

Allow formsy to be shared with parent through context#249
calvinfroedge wants to merge 1 commit into
christianalfoni:masterfrom
calvinfroedge:master

Conversation

@calvinfroedge

Copy link
Copy Markdown

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