Created
February 3, 2020 22:55
-
-
Save blikblum/ad9e94ff16fa9a0c4fc5d0e83bf13223 to your computer and use it in GitHub Desktop.
Markdium-From React to Web Components: using hooks
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
const ref = directive((refInstance) => (part) => { | |
if (!(part instanceof AttributePart)) { | |
throw new Error('ref directive can only be used as an attribute'); | |
} | |
refInstance.current = part.committer.element; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment