The PRE
component is used to render preformatted text blocks, typically used to display code or formatted data in a way that maintains spacing and line breaks as it is in the source.
import React from 'react';
import { PRE } from '~/ui/components/Text';
export default function App() {
return (
<div>
<PRE>
function hello() {'{\n'}
console.log("Hello, world!");{'\n'}
{'}'}
</PRE>
</div>
);
}
function hello() { console.log("Hello, world!") }
The PRE
component accepts all standard HTML preformatted text attributes, allowing for wide customization in how preformatted text is displayed.