Git Product home page Git Product logo

Comments (8)

grxy avatar grxy commented on May 24, 2024 1

@ctrlplusb The issue happens when you have multiple react components that are siblings, so if you updated your tree to be:

const tree = (
      <OnlyChildren something={1}>
        <OnlyChildren something={2}>
          <div>Hello world!</div>
        </OnlyChildren>
        <OnlyChildren something={3}>
          <div>Hello world!</div>
        </OnlyChildren>
      </OnlyChildren>
    )

you would expect actual to be [1, 2, 3], when in fact the children are never visited, resulting in actual being only [1]. See screenshot:

image

from react-tree-walker.

ctrlplusb avatar ctrlplusb commented on May 24, 2024

Hey @grxy

Awesome, thanks so much for picking this up. I'll try review and merge within the next 24 hours. 👍

from react-tree-walker.

grxy avatar grxy commented on May 24, 2024

@ctrlplusb No prob, dude. I actually noticed the issue when writing unit tests for my code while using this.

P.S. Great work breaking it out from react-apollo!

from react-tree-walker.

ctrlplusb avatar ctrlplusb commented on May 24, 2024

Hi @grxy 👋

Apologies for the late one on this.

I have struggled to recreate your initial issue. I have added another branch containing a test that I was initially expecting to fail as it doesn't have your fix applied. The test passes though.

Do you mind having a look to see if I have configured the test correctly?

Thanks!

from react-tree-walker.

ctrlplusb avatar ctrlplusb commented on May 24, 2024

Perfect thanks!

from react-tree-walker.

grxy avatar grxy commented on May 24, 2024

@ctrlplusb Any chance you'll be able to merge my PR and publish 2.1.2 soon?

from react-tree-walker.

ctrlplusb avatar ctrlplusb commented on May 24, 2024

All done and published. Thanks for being persistent with me!

from react-tree-walker.

grxy avatar grxy commented on May 24, 2024

@ctrlplusb Great! Thank you!

from react-tree-walker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.