Git Product home page Git Product logo

Comments (4)

fernandopasik avatar fernandopasik commented on June 4, 2024

The behaviour is the expected, because div is analyzed first and filtered out since is not a span. It doesn't matter what is grandchildren, if the child is already filtered out.

I think the example in the website illustrates this https://fernandopasik.com/react-children-utilities/deep-filter

from react-children-utilities.

lufia avatar lufia commented on June 4, 2024

I see. Thank you.

from react-children-utilities.

fabpico avatar fabpico commented on June 4, 2024

@fernandopasik I was also confused about this behavior. With deep, I expected a traversal through all children first. Currently I would more call it shallow-deep 😄. So currently if I want to find deep children, all parents must also match the filter criteria, which does not apply for my use case. My use case is to get required form elements from a complex nested form.
I could use deepForEach and add matches into a new array, but I liked the idea to use deepFilter.

May be reopen or make an option for it? Or make the stopping for going deeper as option, and deep traverse by default?

from react-children-utilities.

fernandopasik avatar fernandopasik commented on June 4, 2024

@fabpico do you have ideas on how to implement it? I gave it a few thoughts but seems like in order to see the grandchildren you need to do some nested rendering which is not straight forward in react

from react-children-utilities.

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.