What are refs used for in React?

What are refs used for in React?

refs are element attributes provided by react to access it directly in dom i used this only for styling.

so to create a refrence to a node in functional component will look like

const showDropdown = (el) => {
     const node = findDOMNode(el)
     $(node). //now you have access to the dom node 
}

const MyComponent = () => {
    const myref = useRef(null) // initial value can be anything here it is null
    return <input ref={myref} onMouseOver={e=>showDropdown(myref.current)}
}