How to change refType in forwardRef based on prop?
imagine you want a React component to have a certain ref type if some prop is present, and another ref type if other prop is present. How you'd achieve it?
say, if it has "disabled" or "type" you want ButtonElement, and if there's "to" or "href" you want AnchorElement
0 Replies