question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not able to traverse more than 1 level of hierarchy

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:17
  • Comments:5

github_iconTop GitHub Comments

6reactions
antonielcommented, Oct 14, 2021

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
3reactions
damiangreencommented, Jun 20, 2022

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Traverse SQL hierarchy from bottom up till specific level reached
So what I'm trying to achieve is - given an Id for a leaf, I want to work up the tree till I...
Read more >
The Performance of Traversing a SQL Hierarchy - Simple Talk
Traverse the Hierarchy Using a Traditional rCTE. When we generate the traversal, we add a level counter and a string that represents the...
Read more >
How to get nested children records more than 1 level deep via ...
Unfortunately this is not possible in a single query. You are trying to traverse multiple levels when moving from Parent-Child.
Read more >
Traversing a schematic hierarchically - Custom IC SKILL
and print all the instances that do not have any schematic view ... level - level down into hierarchy, used just to indent...
Read more >
how to traverse the tree in reverse direction? - Ask TOM
The AskTOM team is taking a break over the holiday season, so we're not ... In a hierarchical query how do I traverse...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found