Created
December 17, 2021 16:58
-
-
Save ChaseH88/2a669b82bde8d7208769169b956a94e9 to your computer and use it in GitHub Desktop.
useRef - TypeScript Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Main Component | |
let myRef = useRef<HTMLDivElement>(null); | |
// Child Component | |
interface MYINTERFACE { | |
// ...props | |
} | |
const Notifications = React.forwardRef<HTMLDivElement, MYINTERFACE>(({ MYPROPS }, ref) => { | |
return <div>My Component</div> | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment