Skip to content

Commit 9c74542

Browse files
📚 Fix example
1 parent ecb34c0 commit 9c74542

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,13 @@ This package contains the global type files for React.
137137

138138
```tsx
139139
// CodeBlock.tsx
140-
import React, {CodeBlockHTMLAttributes} from 'react';
141-
import '@heppokofrontend/html-code-block-element';
140+
import React, {useEffect, CodeBlockHTMLAttributes} from 'react';
142141

143142
export const CodeBlock: React.FC<CodeBlockHTMLAttributes<HTMLElement>> = ({children, ...props}) => {
143+
useEffect(() => {
144+
import(`@heppokofrontend/html-code-block-element`);
145+
});
146+
144147
return (
145148
<code-block {...props}>{children}</code-block>
146149
);

0 commit comments

Comments
 (0)