{"action":"closed","issue":{"url":"https://api.github.com/repos/tannerlinsley/react-form/issues/13","repository_url":"https://api.github.com/repos/tannerlinsley/react-form","labels_url":"https://api.github.com/repos/tannerlinsley/react-form/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/tannerlinsley/react-form/issues/13/comments","events_url":"https://api.github.com/repos/tannerlinsley/react-form/issues/13/events","html_url":"https://github.com/tannerlinsley/react-form/issues/13","id":196601793,"number":13,"title":"getValue() and Controlled 3rd party components","user":{"login":"timothyallan","id":1995135,"avatar_url":"https://avatars.githubusercontent.com/u/1995135?v=3","gravatar_id":"","url":"https://api.github.com/users/timothyallan","html_url":"https://github.com/timothyallan","followers_url":"https://api.github.com/users/timothyallan/followers","following_url":"https://api.github.com/users/timothyallan/following{/other_user}","gists_url":"https://api.github.com/users/timothyallan/gists{/gist_id}","starred_url":"https://api.github.com/users/timothyallan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timothyallan/subscriptions","organizations_url":"https://api.github.com/users/timothyallan/orgs","repos_url":"https://api.github.com/users/timothyallan/repos","events_url":"https://api.github.com/users/timothyallan/events{/privacy}","received_events_url":"https://api.github.com/users/timothyallan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-20T07:10:05Z","updated_at":"2016-12-21T17:02:17Z","closed_at":"2016-12-21T17:02:17Z","body":"Hi there,\r\n\r\nI'm using the Material UI TextField component as a drop in replacement for your React Select demo and giving your library a spin. Few things that popped up that aren't necessarily anything to do with your library, but may be worthwhile thinking about :)\r\n\r\nHere's the code:\r\n\r\n```\r\nimport React from 'react'\r\nimport { FormInput } from 'react-form'\r\nimport TextField from 'material-ui/TextField';\r\nexport default ({ field, ...rest }) => {\r\n  return (\r\n    <FormInput field={field}>\r\n      {({ setValue, getValue, setTouched }) => {\r\n        return (\r\n          <TextField\r\n            {...rest} // Send the rest of your props to React-Select\r\n            value={getValue() || ''} // Set the value to the forms value\r\n            onChange={val => setValue(val.target.value) } // On Change, update the form value\r\n            onBlur={() => setTouched()} // And the same goes for touched\r\n            name=\"testext\"\r\n          />\r\n        );\r\n      }}\r\n    </FormInput>\r\n  );\r\n}\r\n```\r\n\r\nNow, Material UI returns the event object in `val`. That caused an infinite loop in your `removeNestedErrorValues` function trying to parse that Object in `return recurse(d, [].concat(_toConsumableArray(path), [i]));`\r\n\r\nEasily fixed once I figured out wtf was going on, but still, an infinite loop when passed bad data.\r\n\r\nSecondly, I'm assuming getValue() returns undefined/null when there's no value. This causes the ol `TextField is changing an uncontrolled input of type text to be controlled.` error as soon as some text is entered. \r\n\r\nAgain easily fixed by the tweak above, but I'm wondering if getValue() should return '' rather than null. \r\n\r\nThoughts?\r\n"}}
{"actor":{"display_login":"tannerlinsley"}}