next-prism
Version:
A lightweight, robust, and elegant syntax highlighting component for your next React apps.
2 lines (1 loc) • 432 B
JavaScript
import e from"react";import n from"prismjs";function t(){var t;return{Code:(t=function(t){var r=t.language,l=t.children,c=t.content,i=t.lineNumbers;return e.useEffect((function(){n.highlightAll()}),[]),e.createElement("pre",null,e.createElement("code",{className:"language-".concat(r," ").concat(i&&"line-numbers"," ")},l||c))},e.useMemo((function(){return t}),[])),highlightAll:function(){n.highlightAll()}}}export{t as usePrism};