Skip to content

Commit 6534235

Browse files
📚 Support to use in React
1 parent e366f5b commit 6534235

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,24 @@ If you are using purely constructors:
126126
import HTMLCodeBlockElement from '@heppokofrontend/html-code-block-element/dist/class/HTMLCodeBlockElement';
127127
```
128128

129+
#### Use in React
130+
131+
This package contains the global type files for React.
132+
 
133+
- `React.CodeBlockHTMLAttributes`
134+
- `code-block` in `JSX.IntrinsicElements`
135+
136+
```tsx
137+
import React, {CodeBlockHTMLAttributes} from 'react';
138+
import '@heppokofrontend/html-code-block-element';
139+
140+
export const CodeBlock: React.FC<CodeBlockHTMLAttributes<HTMLElement>> = ({children, ...props}) => {
141+
return (
142+
<code-block {...props}>{children}</code-block>
143+
);
144+
};
145+
```
146+
129147
#### Use as constructor
130148

131149
Manual setup:

0 commit comments

Comments
 (0)