Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

react get input value on button click functional component

const input = props => {

let textInput = React.createRef();

function handleClick() {
  console.log(textInput.current.value);
}

return (
    <div>
      <input ref={textInput} placeholder="Type a message..." />
      <div onClick={handleClick} className="icon">
        <i className="fa fa-play" />
      </div>
    </div>
  )
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: vue + change router link active class 
Javascript :: c# get value from json object 
Javascript :: console.time js 
Javascript :: yellowbox react native 
Javascript :: fuse.js cdn 
Javascript :: JS class for each 
Javascript :: allow only integer or float in text fields jQuery 
Javascript :: npm update react 
Javascript :: mongoose unique 
Javascript :: js paste event 
Javascript :: nextauth dynamic redirect after login 
Javascript :: get text of selected option js 
Javascript :: javascript float 2 decimal 
Javascript :: how to find the width of outerconatiner in react native 
Javascript :: vetur Property has no initializer and is not definitely assigned in 
Javascript :: Material App debug mode 
Javascript :: react native monorepo module resolver outside app 
Javascript :: jquery nearest 
Javascript :: jsx emmet vscode 
Javascript :: angular input date binding on variable update 
Javascript :: how to replace word from string in javascript 
Javascript :: javascript removing item from array 
Javascript :: Cannot download "https://github.com/sass/node-sass 
Javascript :: Chamando métodos de utilidade com consign( ) no nodeJs 
Javascript :: how to round double value in js 
Javascript :: javascript discord bot 8 ball command 
Javascript :: jquery if input has empty white space 
Javascript :: custom error js 
Javascript :: js does forEach respect order 
Javascript :: ClassNotFoundException: com.fasterxml.jackson.core.JsonGenerator 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =