Skip to content

Instantly share code, notes, and snippets.

@blikblum
Created February 3, 2020 22:55
Show Gist options
  • Save blikblum/ad9e94ff16fa9a0c4fc5d0e83bf13223 to your computer and use it in GitHub Desktop.
Save blikblum/ad9e94ff16fa9a0c4fc5d0e83bf13223 to your computer and use it in GitHub Desktop.
Markdium-From React to Web Components: using hooks
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