Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.
This repository was archived by the owner on Aug 23, 2022. It is now read-only.

Question: Access LocalForm State #1204

Description

@diego-toro

The Problem

I have a ParentComponent grouping together some controls, and I've looking to access the form state in terms to hide or show some other controls depending on the value of some of the other controls. Any way to do that without moving the entire form state from the container to the child component? anything like a redux connect?

// ParentComponent grouping of fields
<FieldSet model=".myGroup">
  <Control.text model=".field1" />
  <Control.text model=".field2" />
  {field1 === ''foo" && <Control.text model=".field3" />}
</FieldSet>

// container
<LocalForm onSubmit={handleSumbit} model="myForm">
  <Control.text model=".fieldParent1" />
  <Control.text model=".fieldParent2" />
  <Control.text model=".fieldParent3" />
  <FieldsGroup />
</LocalForm>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions