useref material ui

Solutions on MaxInterview for useref material ui by the best coders in the world

showing results for - "useref material ui"
Naia
17 Feb 2017
1// Using the useRef() hook. Only possible when you're using a function component.
2const App = () => {
3  const textRef = useRef();
4  const showRefContent = () => {
5    console.log(textRef.current.value);
6  };
7  return (
8    <div className="App">
9      <TextField inputRef={textRef} />
10      <button onClick={showRefContent}>Click</button>
11    </div>
12  );
13}
14