{"action":"created","issue":{"url":"https://api.github.com/repos/davidkpiano/react-redux-form/issues/789","repository_url":"https://api.github.com/repos/davidkpiano/react-redux-form","labels_url":"https://api.github.com/repos/davidkpiano/react-redux-form/issues/789/labels{/name}","comments_url":"https://api.github.com/repos/davidkpiano/react-redux-form/issues/789/comments","events_url":"https://api.github.com/repos/davidkpiano/react-redux-form/issues/789/events","html_url":"https://github.com/davidkpiano/react-redux-form/issues/789","id":229289164,"number":789,"title":"Accessing state, without form? mapStateToProps?","user":{"login":"businessnumbertwo","id":26924512,"avatar_url":"https://avatars3.githubusercontent.com/u/26924512?v=3","gravatar_id":"","url":"https://api.github.com/users/businessnumbertwo","html_url":"https://github.com/businessnumbertwo","followers_url":"https://api.github.com/users/businessnumbertwo/followers","following_url":"https://api.github.com/users/businessnumbertwo/following{/other_user}","gists_url":"https://api.github.com/users/businessnumbertwo/gists{/gist_id}","starred_url":"https://api.github.com/users/businessnumbertwo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/businessnumbertwo/subscriptions","organizations_url":"https://api.github.com/users/businessnumbertwo/orgs","repos_url":"https://api.github.com/users/businessnumbertwo/repos","events_url":"https://api.github.com/users/businessnumbertwo/events{/privacy}","received_events_url":"https://api.github.com/users/businessnumbertwo/received_events","type":"User","site_admin":false},"labels":[{"id":298251641,"url":"https://api.github.com/repos/davidkpiano/react-redux-form/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-05-17T09:23:12Z","updated_at":"2017-05-17T14:10:46Z","closed_at":null,"body":"Guys\r\n\r\nVery sorry to raise this here - but its a question not a bug. I'm very new to react, react-redux and react-redux-forms...\r\n\r\nI'm using RRF to create all my models and forms. How though do I access the state, outside a Form or Control component. Basically I want to pass a value to a function which is held in the state. I've tried using the react-redux approach of mapping piece of the state to a prop using connect(), but this ended in bunch of errors\r\n\r\nI'm assuming importing store from Redux and calling getState is not best practice either?\r\n\r\nGot the feeling I'm barking up the wrong tree!\r\n\r\nMany thanks, Phil"},"comment":{"url":"https://api.github.com/repos/davidkpiano/react-redux-form/issues/comments/302102239","html_url":"https://github.com/davidkpiano/react-redux-form/issues/789#issuecomment-302102239","issue_url":"https://api.github.com/repos/davidkpiano/react-redux-form/issues/789","id":302102239,"user":{"login":"businessnumbertwo","id":26924512,"avatar_url":"https://avatars3.githubusercontent.com/u/26924512?v=3","gravatar_id":"","url":"https://api.github.com/users/businessnumbertwo","html_url":"https://github.com/businessnumbertwo","followers_url":"https://api.github.com/users/businessnumbertwo/followers","following_url":"https://api.github.com/users/businessnumbertwo/following{/other_user}","gists_url":"https://api.github.com/users/businessnumbertwo/gists{/gist_id}","starred_url":"https://api.github.com/users/businessnumbertwo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/businessnumbertwo/subscriptions","organizations_url":"https://api.github.com/users/businessnumbertwo/orgs","repos_url":"https://api.github.com/users/businessnumbertwo/repos","events_url":"https://api.github.com/users/businessnumbertwo/events{/privacy}","received_events_url":"https://api.github.com/users/businessnumbertwo/received_events","type":"User","site_admin":false},"created_at":"2017-05-17T14:10:45Z","updated_at":"2017-05-17T14:10:45Z","body":"Ah yes! That makes perfect sense…by mapping some state to a prop, then updating the mapped state in componentWillReceiveProps, I get myself into an endless loop, as the connected prop gets updated! But mapping a specific field the props themselves are not updated! I would have never spotted that - I’m still very much the novice.\n\nBasically the form can be in one of two modes, create / update. If say the user has a form on screen with data in it, then clicks “Create New” from a top level menu, the form is not remounted, so I have to ensure the form is cleared out (hence the code in componentWillReceiveProps  I have also allowed it to reload the form with a new record also - say I added a Next Record button on the screen.\n\nI need to think about how to architect this…I will try and put up in code pen later.\n\nTHANK YOU SO MUCH!\n\nPhil\n\n\n> On 17 May 2017, at 14:55, David Khourshid <notifications@github.com> wrote:\n> \n> If you could put that in a Codepen that would be great (template here: http://codepen.io/davidkpiano/pen/yJwmEa <http://codepen.io/davidkpiano/pen/yJwmEa> ) but I suspect the infinite loop has to do with componentWillReceiveProps, because you're dispatching actions that can change props.\n> \n> —\n> You are receiving this because you authored the thread.\n> Reply to this email directly, view it on GitHub <https://github.com/davidkpiano/react-redux-form/issues/789#issuecomment-302097719>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AZrV4N-Ag36bk5Ig6FBf940aH6woSEh6ks5r6vxkgaJpZM4NdmDx>.\n> \n\n"}}
{"actor":{"display_login":"businessnumbertwo"}}