Answers for "useref material ui"

0

useref material ui

// Using the useRef() hook. Only possible when you're using a function component.
const App = () => {
  const textRef = useRef();
  const showRefContent = () => {
    console.log(textRef.current.value);
  };
  return (
    <div className="App">
      <TextField inputRef={textRef} />
      <button onClick={showRefContent}>Click</button>
    </div>
  );
}
Posted by: Guest on December-29-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language