Posts

Showing posts from June, 2021

How to set focus to next input on enter key press in use ref hook in material ui text field

Image
Create an array of refs import React, {useState, useRef} from 'react'; export default function App() { const inputRefs = useRef([]); } Creating empty array with the length of 10 length = 10; import React, {useState, useRef} from 'react'; export default function App() { const inputRefs = useRef([]); const [data] = useState(...Array(length).keys()); } Source Medium Visit Medium For Full Source Thank you for reading Follow Us on Instagram Twitter Linked in Medium