Skip to content

Instantly share code, notes, and snippets.

View victorpavlenko's full-sized avatar
🎯
Focusing

React victorpavlenko

🎯
Focusing
View GitHub Profile
@victorpavlenko
victorpavlenko / gist:6f5862cf430fa342d18594d8af4d1ae5
Created January 16, 2019 12:26
Замыкание в functional component
Замыкание в functional component
function CustomForm ({handleSubmit}) {
let inputElement
return (
<form onSubmit={() => handleSubmit(inputElement.value)}>
<input
type='text'
ref={(input) => inputElement = input} />
<button type='submit'>Submit</button>