-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Expected onClick listener to be a function, instead got a value of string type. #235
Comments
Hi Vallerian, |
Unfortunately, no, but if you find a way to extract the content of code blocks within React components using Rehype or Remark plugins, like remark-code-blocks, I'd be happy if you let me know. |
unfortunately the copy button transformer currently doesn't work with Next.js unless you use a Server Component Example implementation: |
This PR adds support for syntax highlighting of TQL code blocks in the docs site. To review, add a TQL code block in any docs or blog page, and run docusaurus. Missing feature: copy to clipboard button, see upstream issue - rehype-pretty/rehype-pretty-code#235. Closes tenzir/issues#2035.
I encountered the same issue when rendering the MDX file and am still seeking a better solution. |
I am encountering an error while using the
rehype-pretty-code
package in a Next.js project, specifically when utilizing thetransformerCopyButton
feature. The error message I receive is:This error seems to occur when the
transformerCopyButton
attempts to render the copy button for code blocks. It appears that the onClick event listener is being assigned a string value instead of a function.Next.js version: 14.2.5
rehype-pretty version: 0.13.2
next.config.mjs
The text was updated successfully, but these errors were encountered: