{"action":"created","issue":{"url":"https://api.github.com/repos/jaredpalmer/formik/issues/754","repository_url":"https://api.github.com/repos/jaredpalmer/formik","labels_url":"https://api.github.com/repos/jaredpalmer/formik/issues/754/labels{/name}","comments_url":"https://api.github.com/repos/jaredpalmer/formik/issues/754/comments","events_url":"https://api.github.com/repos/jaredpalmer/formik/issues/754/events","html_url":"https://github.com/jaredpalmer/formik/issues/754","id":339987868,"node_id":"MDU6SXNzdWUzMzk5ODc4Njg=","number":754,"title":"Access FieldArray imperatively","user":{"login":"casperOne","id":561862,"node_id":"MDQ6VXNlcjU2MTg2Mg==","avatar_url":"https://avatars1.githubusercontent.com/u/561862?v=4","gravatar_id":"","url":"https://api.github.com/users/casperOne","html_url":"https://github.com/casperOne","followers_url":"https://api.github.com/users/casperOne/followers","following_url":"https://api.github.com/users/casperOne/following{/other_user}","gists_url":"https://api.github.com/users/casperOne/gists{/gist_id}","starred_url":"https://api.github.com/users/casperOne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/casperOne/subscriptions","organizations_url":"https://api.github.com/users/casperOne/orgs","repos_url":"https://api.github.com/users/casperOne/repos","events_url":"https://api.github.com/users/casperOne/events{/privacy}","received_events_url":"https://api.github.com/users/casperOne/received_events","type":"User","site_admin":false},"labels":[{"id":626821599,"node_id":"MDU6TGFiZWw2MjY4MjE1OTk=","url":"https://api.github.com/repos/jaredpalmer/formik/labels/enhancement","name":"enhancement","color":"0052cc","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-10T20:06:19Z","updated_at":"2018-07-11T22:40:26Z","closed_at":null,"author_association":"NONE","body":"Is there a way to get the API object exposed by the render method of the `FieldArray` component imperatively?\r\n\r\nI have an adapter on top of Formik which exposes array helpers as well, so I don't want to rely on provider specific components as a prerequisite."},"comment":{"url":"https://api.github.com/repos/jaredpalmer/formik/issues/comments/404332816","html_url":"https://github.com/jaredpalmer/formik/issues/754#issuecomment-404332816","issue_url":"https://api.github.com/repos/jaredpalmer/formik/issues/754","id":404332816,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDMzMjgxNg==","user":{"login":"casperOne","id":561862,"node_id":"MDQ6VXNlcjU2MTg2Mg==","avatar_url":"https://avatars1.githubusercontent.com/u/561862?v=4","gravatar_id":"","url":"https://api.github.com/users/casperOne","html_url":"https://github.com/casperOne","followers_url":"https://api.github.com/users/casperOne/followers","following_url":"https://api.github.com/users/casperOne/following{/other_user}","gists_url":"https://api.github.com/users/casperOne/gists{/gist_id}","starred_url":"https://api.github.com/users/casperOne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/casperOne/subscriptions","organizations_url":"https://api.github.com/users/casperOne/orgs","repos_url":"https://api.github.com/users/casperOne/repos","events_url":"https://api.github.com/users/casperOne/events{/privacy}","received_events_url":"https://api.github.com/users/casperOne/received_events","type":"User","site_admin":false},"created_at":"2018-07-11T22:40:26Z","updated_at":"2018-07-11T22:40:26Z","author_association":"NONE","body":"@jaredpalmer Thanks for the response, apologies though, I don't think I explained what I am looking for correctly.\r\n\r\nCurrently, if I want to access [the `ahttps://github.com/jaredpalmer/formik#render-arrayhelpers-arrayhelpers--reactreactnoderrayHelpers` exposed by the `render` prop of the `FieldArray` imperatively.](url).\r\n\r\nSo instead of doing this:\r\n\r\n````\r\n<FieldArray\r\n    name='arrayProperty'\r\n    render={\r\n        arrayHelpers => {\r\n            // arrayHelpers is a set of helpers on the array exposed by \r\n            // 'arrayProperty' in the data model.\r\n        }\r\n    }\r\n/>\r\n````\r\n\r\nInstead, I'd like to call some sort of function (maybe something off the `render` property exposed by the `Formik` component, or a global function) which will give me the helper exposed above in `arrayHelper`.\r\n\r\nFor example:\r\n\r\n````\r\n<Formik\r\n    ...\r\n    render={\r\n        formApi => {\r\n            // Render stuff.\r\n            ...\r\n\r\n            // Get array helper from global function...\r\n            const arrayPropertyHelper = getArrayHelper('arrayProperty')\r\n           \r\n            // or something hanging off formApi\r\n            const arrayPropertyHelper = formApi.getArrayHelper('arrayProperty')\r\n\r\n            // Call methods on arrayPropertyHelper\r\n            arrayPropertyHelper.insert(0, 'hello')\r\n            arrayPropertyHelper.remove(0)\r\n        }\r\n    }\r\n/>\r\n````\r\nUltimately, I have an adapter over `formApi`  above which is exposed by a context (to prevent excessive prop drilling); the adapter interface has array operations as well.  I'd like to prevent provider-specific constructs (in this case, the `FieldArray` component) from being used."}}
{"actor":{"display_login":"casperOne"}}