sapling icon indicating copy to clipboard operation
sapling copied to clipboard

Not able to traverse more than 1 level of hierarchy

Open nareshbhatia opened this issue 3 years ago • 7 comments

Describe the bug Sapling is not able to traverse more than one level of my component tree. I have tried it on several of my projects.

To Reproduce Steps to reproduce the behavior:

  1. Clone this repo: https://github.com/PublicisSapient/accelerated-news
  2. Choose the file src/App.tsx
  3. You will see that only the top level children are shown.
CleanShot 2021-10-11 at 19 34 24@2x

I thought maybe this is because the pages are embedded in routes. So I tried the same thing with a single page: src/Pages/SignUpPage/SignUpPage.tsx. This is what I got:

CleanShot 2021-10-11 at 19 41 44@2x

Note that traversal stopped at TextField, even though there are components under that.

Expected behavior Full traversal of the component tree.

Screenshots See above.

Desktop (please complete the following information):

  • OS: [e.g. iOS] MacOS
  • Browser [e.g. chrome, safari] Chrome
  • Version [e.g. 22] 94

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context Add any other context about the problem here.

nareshbhatia avatar Oct 11 '21 23:10 nareshbhatia

I am having the same problem. Would love for it to work!

schoinh avatar Oct 13 '21 22:10 schoinh

I also have this issue.

horne3754sg avatar Oct 14 '21 07:10 horne3754sg

After some investigation, I've find the issue on the getFileName method, the wrong behavior occurs when try to get a import from an index file like: import {...} from './pages'; it tries to search in a folder by the fileName, but in this case we're using a import direct from index, so the fileName will not match with the correct file.

e.g looking for SignUpPage it will try to find in the fileArray the /pages.(j|t)sx?$/ regex, that will returns undefined

variables Method
image image

antoniel avatar Oct 14 '21 13:10 antoniel

Any update on this?

jdgreenberger avatar May 20 '22 13:05 jdgreenberger

I would love to use this extension, but until this is fixed it's not of much use.

damiangreen avatar Jun 20 '22 09:06 damiangreen

It's been almost a year since anyone has commented on this, but it is still a problem for me today.

khahn-hw avatar May 03 '23 18:05 khahn-hw

One year later...

krummja avatar Jun 18 '24 17:06 krummja