How to set focus to next input on enter key press in use ref hook in material ui text field
Create an array of refs
import React, {useState, useRef} from 'react';
export default function App() {
const inputRefs = useRef([]);
}
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());
}
import React, {useState, useRef} from 'react';
export default function App() {
const inputRefs = useRef([]);
const [data] = useState(...Array(length).keys());
}
Comments
Post a Comment