{"action":"created","issue":{"url":"https://api.github.com/repos/erikras/redux-form/issues/657","repository_url":"https://api.github.com/repos/erikras/redux-form","labels_url":"https://api.github.com/repos/erikras/redux-form/issues/657/labels{/name}","comments_url":"https://api.github.com/repos/erikras/redux-form/issues/657/comments","events_url":"https://api.github.com/repos/erikras/redux-form/issues/657/events","html_url":"https://github.com/erikras/redux-form/issues/657","id":134325517,"number":657,"title":"Way to edit entity with reference","user":{"login":"krzysztofpniak","id":2463068,"avatar_url":"https://avatars.githubusercontent.com/u/2463068?v=3","gravatar_id":"","url":"https://api.github.com/users/krzysztofpniak","html_url":"https://github.com/krzysztofpniak","followers_url":"https://api.github.com/users/krzysztofpniak/followers","following_url":"https://api.github.com/users/krzysztofpniak/following{/other_user}","gists_url":"https://api.github.com/users/krzysztofpniak/gists{/gist_id}","starred_url":"https://api.github.com/users/krzysztofpniak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krzysztofpniak/subscriptions","organizations_url":"https://api.github.com/users/krzysztofpniak/orgs","repos_url":"https://api.github.com/users/krzysztofpniak/repos","events_url":"https://api.github.com/users/krzysztofpniak/events{/privacy}","received_events_url":"https://api.github.com/users/krzysztofpniak/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-02-17T16:14:44Z","updated_at":"2016-02-17T17:23:45Z","closed_at":"2016-02-17T17:23:23Z","body":"I'm using data from Parse.com REST api. The entry looks like this:\r\n```\r\n{\r\n    \"configuration\":{\r\n        \"__type\":\"Pointer\",\r\n        \"className\":\"Configuration\",\r\n        \"objectId\":\"WFWIzf5Y1m\"\r\n    },\r\n    \"createdAt\":\"2016-02-17T08:45:15.064Z\",\r\n    \"name\":\"KP\",\r\n    \"objectId\":\"DQUDbCx5DK\",\r\n    \"updatedAt\":\"2016-02-17T08:45:46.699Z\"\r\n}\r\n```\r\n\r\nHow should I write a form to bind a configuration to select control?\r\nI think this question is related a little bit to this one:\r\nhttps://github.com/erikras/redux-form/issues/642\r\n\r\nFrom my perspective it should stop expanding value at a place defined in the `fields` array on `@reduxForm`."},"comment":{"url":"https://api.github.com/repos/erikras/redux-form/issues/comments/185311520","html_url":"https://github.com/erikras/redux-form/issues/657#issuecomment-185311520","issue_url":"https://api.github.com/repos/erikras/redux-form/issues/657","id":185311520,"user":{"login":"erikras","id":4396759,"avatar_url":"https://avatars.githubusercontent.com/u/4396759?v=3","gravatar_id":"","url":"https://api.github.com/users/erikras","html_url":"https://github.com/erikras","followers_url":"https://api.github.com/users/erikras/followers","following_url":"https://api.github.com/users/erikras/following{/other_user}","gists_url":"https://api.github.com/users/erikras/gists{/gist_id}","starred_url":"https://api.github.com/users/erikras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erikras/subscriptions","organizations_url":"https://api.github.com/users/erikras/orgs","repos_url":"https://api.github.com/users/erikras/repos","events_url":"https://api.github.com/users/erikras/events{/privacy}","received_events_url":"https://api.github.com/users/erikras/received_events","type":"User","site_admin":false},"created_at":"2016-02-17T17:23:45Z","updated_at":"2016-02-17T17:23:45Z","body":"Okay. Given your record shape you stated above, and that you only want to edit the `name` and `configuration` (I'm assuming that's like a foreign key pointing at a `Configuration` object), you'd do something like this:\r\n\r\n```js\r\nclass CustomConfigSelector extends Component {\r\n  static propTypes = {\r\n    value: PropTypes.object,\r\n    onChange: PropTypes.func.isRequired\r\n  };\r\n\r\n  render() {\r\n    const {value, onChange} = this.props;\r\n    return <div>some selector that uses value and onChange</div>;\r\n  }\r\n}\r\n\r\nclass ConfigForm extends Component {\r\n  render() {\r\n    const {{fields: {name, configuration}, handleSubmit} = this.props;\r\n    return (\r\n      <form onSubmit={handleSubmit}>\r\n        <input type=\"text\" {...name}/>\r\n        <CustomConfigSelector {...configuration}/>\r\n      </form>\r\n    );\r\n  }\r\n}\r\n\r\nexport default reduxForm({\r\n  form: 'config',\r\n  fields: ['name', 'configuration', 'objectId'] // objectId is included so that it is in the submitted values\r\n})(ConfigForm);\r\n```"}}