bkrem / react-d3-tree

:deciduous_tree: React component to create interactive D3 tree graphs
https://bkrem.github.io/react-d3-tree
MIT License
1.06k stars 268 forks source link

Question: How do you import type `TreeProps`? #440

Closed remarkablemark closed 1 year ago

remarkablemark commented 1 year ago

Are you reporting a bug, or opening a feature request?

TypeScript question

What is the actual behavior/output?

Importing type throws error:

Screen Shot 2023-02-05 at 5 25 03 PM

I ended up having to import the type with:

import { TreeProps } from 'react-d3-tree/lib/types/Tree/types'

What is the behavior/output you expect?

Importing type should work:

import type { TreeProps } from 'react-d3-tree'

Can you consistently reproduce the issue/create a reproduction case (e.g. on https://codesandbox.io)?

https://replit.com/@remarkablemark/react-d3-tree#src/CenteredTree.tsx

What version of react-d3-tree are you using?

3.5.0

If react-d3-tree crashed with a traceback, please paste the full traceback below.

N/A

Devamchaudhari commented 1 year ago

@remarkablemark
try to import like this :arrow_down_small: import { TreeProps } from 'react-d3-tree/lib/Tree/types';

remarkablemark commented 1 year ago

Thanks @Devamchaudhari!

Devamchaudhari commented 1 year ago

Thanks @Devamchaudhari!

Welcome @remarkablemark :smile: