Skip to content
Discussion options

You must be logged in to vote

Hi @rmatuszczakp,

Thanks for posting this! Would a copyTextFormatter prop work for your use case? It would work like this:

const myCodeBlock = () => {
  const myCode = `const id = XXXX`;
  
  return (
    <CodeBlock
      code={myCode}
      language='javascript'
      copyTextFormatter={(myCode) => {
          const formattedCode = myCode;
          // do something to the string
          return formattedCode;
      }}
   />
  )
}

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@rmatuszczakp
Comment options

@rmatuszczakp
Comment options

@shleewhite
Comment options

@nkrantz
Comment options

Answer selected by nkrantz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants