Skip to content

Commit 8ee0525

Browse files
committed
chore: minimal changes
1 parent 5730983 commit 8ee0525

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

src/beautiful-tree.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,21 @@ export type Tree = {
77
}
88

99
export interface BeautifulTreeProps {
10-
tree: Tree
10+
id: string,
11+
svgProps: {
12+
width: number,
13+
height: number,
14+
},
15+
tree: Tree,
1116
}
1217

13-
export const BeautifulTree = (props: BeautifulTreeProps) => {
14-
console.log(props)
18+
export function BeautifulTree(props: BeautifulTreeProps) {
19+
return (
20+
<svg
21+
xmlns="http://www.w3.org/2000/svg"
22+
id={props.id}
23+
viewBox={`0 0 ${props.svgProps.width} ${props.svgProps.height}`}
24+
className={'beautiful-tree-react'}
25+
></svg>
26+
)
1527
}

vite.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ export default defineConfig({
1717
rollupOptions: {
1818
// make sure to externalize deps that shouldn't be bundled
1919
// into your library
20-
external: ['react'],
20+
external: ['react', 'react-dom'],
2121
output: {
2222
// Provide global variables to use in the UMD build
2323
// for externalized deps
2424
globals: {
2525
react: 'React',
26+
'react-dom': 'ReactDOM',
2627
},
2728
},
2829
},

0 commit comments

Comments
 (0)