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

Controls do not work for nested elements #14

Open
steven-r opened this issue Apr 9, 2020 · 1 comment
Open

Controls do not work for nested elements #14

steven-r opened this issue Apr 9, 2020 · 1 comment

Comments

@steven-r
Copy link

steven-r commented Apr 9, 2020

With formik it's possible to created nested elements:

const initialData = {
  displayName: '',
  name: {
      givenName: '',
      familyName: '',
    }
}

It is now possible to define a field like this:

<Field name="name.givenName" ... />

Using reactstrap-formik controls this doesn't work.

@bradmajewski-at-parchment

This can easily be done by replacing errors[fields.name] with getIn(errors, fields.name)

The getIn function can be imported from formik: import {getIn} from 'formik';.

I extracted the project into a single file and fixed it here: https://gist.github.com/bradmajewski-at-parchment/7b53fcd484fb554942e43cc5ef8a1fb5

LaplancheMaxime referenced this issue in LaplancheMaxime/reactstrap-formik-adapter Nov 25, 2021
Add getIn() formik method to use nested formik elements #14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants