-
Hi, If I have a component like this: const CodeBlock = ({ children }) => {
return (
<pre className={styles.codeBlock}>
<code>{children}</code>
</pre>
);
}; How can I pass verbatim text, containing special characters such as ## Example 1
Here's an example:
<CodeBlock>
public class Main {
public static void main(String[] args) {
}
}
</CodeBlock>
That was the example. |
Beta Was this translation helpful? Give feedback.
Answered by
wooorm
Oct 31, 2022
Replies: 1 comment
-
Do the same you would in JSX. Use an expression: <CodeBlock>{`
public class Main {
public static void main(String[] args) {
}
}
`}</CodeBlock> |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
behrangsa
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do the same you would in JSX. Use an expression: