{"action":"created","issue":{"url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/issues/2418","repository_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap","labels_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/issues/2418/labels{/name}","comments_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/issues/2418/comments","events_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/issues/2418/events","html_url":"https://github.com/react-bootstrap/react-bootstrap/issues/2418","id":198521957,"node_id":"MDU6SXNzdWUxOTg1MjE5NTc=","number":2418,"title":"How to get the value of a FormControl input. ","user":{"login":"localjo","id":516388,"node_id":"MDQ6VXNlcjUxNjM4OA==","avatar_url":"https://avatars2.githubusercontent.com/u/516388?v=4","gravatar_id":"","url":"https://api.github.com/users/localjo","html_url":"https://github.com/localjo","followers_url":"https://api.github.com/users/localjo/followers","following_url":"https://api.github.com/users/localjo/following{/other_user}","gists_url":"https://api.github.com/users/localjo/gists{/gist_id}","starred_url":"https://api.github.com/users/localjo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/localjo/subscriptions","organizations_url":"https://api.github.com/users/localjo/orgs","repos_url":"https://api.github.com/users/localjo/repos","events_url":"https://api.github.com/users/localjo/events{/privacy}","received_events_url":"https://api.github.com/users/localjo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-01-03T17:12:34Z","updated_at":"2018-06-09T18:49:03Z","closed_at":"2017-01-03T17:12:39Z","author_association":"NONE","body":"I'm posting this here since I had a really hard time finding the answer and it may be useful to someone else. This is a followup to https://github.com/react-bootstrap/react-bootstrap/issues/1850#issuecomment-270026825 which was locked before the solution was posted.\r\n\r\nIf you want to get the value of an input element from a FormControl [without using `findDOMNode`, since that will eventually be deprecated](https://github.com/yannickcr/eslint-plugin-react/issues/678#issue-165177220), you can use [the `inputRef` prop](https://react-bootstrap.github.io/components.html#forms-props-form-control).\r\n\r\nSomething like this example should work;\r\n```\r\nclass MyComponent extends Component {\r\n  componentDidMount() {\r\n    this.inputNode.value;\r\n  }\r\n\r\n  render() {\r\n    return (\r\n      <div>\r\n        <FormControl inputRef={node => this.inputNode = node} type=\"text\" />\r\n      </div>\r\n    )\r\n  }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/issues/comments/395990700","html_url":"https://github.com/react-bootstrap/react-bootstrap/issues/2418#issuecomment-395990700","issue_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/issues/2418","id":395990700,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NTk5MDcwMA==","user":{"login":"mikeitexpert","id":31081334,"node_id":"MDQ6VXNlcjMxMDgxMzM0","avatar_url":"https://avatars1.githubusercontent.com/u/31081334?v=4","gravatar_id":"","url":"https://api.github.com/users/mikeitexpert","html_url":"https://github.com/mikeitexpert","followers_url":"https://api.github.com/users/mikeitexpert/followers","following_url":"https://api.github.com/users/mikeitexpert/following{/other_user}","gists_url":"https://api.github.com/users/mikeitexpert/gists{/gist_id}","starred_url":"https://api.github.com/users/mikeitexpert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikeitexpert/subscriptions","organizations_url":"https://api.github.com/users/mikeitexpert/orgs","repos_url":"https://api.github.com/users/mikeitexpert/repos","events_url":"https://api.github.com/users/mikeitexpert/events{/privacy}","received_events_url":"https://api.github.com/users/mikeitexpert/received_events","type":"User","site_admin":false},"created_at":"2018-06-09T18:49:03Z","updated_at":"2018-06-09T18:49:03Z","author_association":"NONE","body":"I get this warning when I tried. \r\n\r\nindex.js:2178 Warning: React does not recognize the `refInput` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `refinput` instead. If you accidentally passed it from a parent component, remove it from the DOM element.\r\n    in input (created by FormControl)\r\n    in FormControl (at Params.js:32)\r\n    in div (created by FormGroup)\r\n    in FormGroup (at Params.js:30)\r\n    in form (created by Form)\r\n    in Form (at Params.js:29)\r\n\r\nand I am using the below stack of dependencies:\r\n\r\n\"bootstrap\": \"^3.3.7\",\r\n    \"isomorphic-fetch\": \"^2.2.1\",\r\n    \"jquery\": \"^3.3.1\",\r\n    \"plotly.js\": \"^1.38.2\",\r\n    \"popper\": \"^1.0.1\",\r\n    \"react\": \"^16.4.0\",\r\n    \"react-bootstrap\": \"^0.32.1\",\r\n    \"react-dom\": \"^16.4.0\",\r\n    \"react-plotly.js\": \"^2.2.0\",\r\n    \"react-redux\": \"^5.0.7\",\r\n    \"react-scripts\": \"1.1.4\",\r\n    \"redux\": \"^4.0.0\",\r\n    \"redux-thunk\": \"^2.3.0\"\r\n\r\n"}}
{"actor":{"display_login":"mikeitexpert"}}