ForwardRef
ForwardRef Interview Questions
2 curated forwardref interview questions with detailed answers and examples.
← Browse all interview questionsUse useRef to create a mutable reference that React attaches to a DOM node after mount. Access the node via ref.current inside useEffect, not during render. Use callback refs to measure elements and forwardRef to expose a child component's DOM node to a parent.
intermediateadvanced hooks-and-patternsreactuseRefdom manipulation
Use forwardRef with useImperativeHandle to expose imperative methods from a child component, or use controlled props to manage disabled state from the parent.
intermediatecomponent communicationreactuseRefforwardRef