bright icon indicating copy to clipboard operation
bright copied to clipboard

Provide a client side version?

Open lucgagan opened this issue 2 years ago • 2 comments

I have a use case where some code examples need to be rendered server-side and others client-side.

It would be nice if I could use the same package for both.

lucgagan avatar Jun 07 '23 21:06 lucgagan

This should be possible without introducing another component or API, instead of using async/await the component could use(highlight()). That's what I've done in my PR here: https://github.com/tom-sherman/react-perfect-syntax-highlighter/pull/4

(note: I created that library before I knew this one existed lol)

The blocker at the moment is that cache() seems to be unimplemented/experimental on the client. In Next.js at least builds completely fail.

tom-sherman avatar Jul 25 '23 21:07 tom-sherman

+1, this would be great to have

jzxhuang avatar Nov 01 '23 20:11 jzxhuang