I don\'t know if I\'m doing this correctly... If I want to get value from an input I use this.refs.whatever.value.trim() but if that input is a stateless function component
@inanc, show good method, but I propose an alternative way to use event target to get the DOM element reference. As you are using the form element, you can name your input elements and use it to access the form object.
const onSubmit = fn => e => {
e.preventDefault()
const city = e.target.city.value // Access elements through `form`
if (city) {
fn(city)
}
}
const MyComponent = ({
onChange
}) => {
return (
)
}