-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPre.mjs
More file actions
30 lines (24 loc) · 731 Bytes
/
Copy pathPre.mjs
File metadata and controls
30 lines (24 loc) · 731 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// @ts-check
import classNameProp from "class-name-prop";
import React from "react";
/** CSS dependency URLs for the React component {@linkcode Pre}. */
export const css = new Set([new URL("./Pre.css", import.meta.url).href]);
/** React component for {@link HTMLPreElement preformatted text}. */
const Pre = React.forwardRef(
(
/**
* @type {React.ComponentPropsWithoutRef<"pre">
* & { [dataAttribute: `data-${string}`]: unknown }}
*/
{ className, ...props },
/** @type {React.ForwardedRef<HTMLPreElement>} */
ref
) =>
React.createElement("pre", {
className: classNameProp("daui-Pre", className),
...props,
ref,
})
);
Pre.displayName = "Pre";
export default Pre;