Skip to content

Instantly share code, notes, and snippets.

@kyleshevlin
Created August 16, 2020 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyleshevlin/14dce798b7ae67a0d3fbe439d006332f to your computer and use it in GitHub Desktop.
Save kyleshevlin/14dce798b7ae67a0d3fbe439d006332f to your computer and use it in GitHub Desktop.
renderless component example
import React from 'react'
export default function PrismHack() {
React.useEffect(() => {
const diffs = [...document.querySelectorAll('.language-diff-javascript')]
diffs.forEach(diff => {
diff.setAttribute('class', 'language-diff-javascript diff-highlight')
})
}, [])
return null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment