Code Monkey home page Code Monkey logo

Comments (6)

tiansijie avatar tiansijie commented on July 20, 2024

@Freakazo could you tell me roughly how big your tree is?

from react-infinity-menu.

Freakazo avatar Freakazo commented on July 20, 2024

The intent is to add in total roughly a hundred leaf nodes, would that be a problem?

I should have specified, the controlItems in the tree above is defined as

let controlItems = [
<ControlItem/>,
]

I get the same error when using something like a Hello react component instance.

The full tree is below as used is below, no adding of leaf nodes at the moment.

        this.state = {
            tree: [
                {
                    name: "controls", /*require*/
                    id: 0, /*require*/
                    isOpen: false, /*require*/
                    customComponent: ControlManage,
                    controlItems: controlItems
                },
                {
                    name: "Dementia",
                    id: 1,
                    isOpen: false,
                    customComponent: ControlIcon,
                    icon: "transform",
                    depth: 0,
                    children: [
                        {
                            id: 0,
                            name: "Any",
                            value: "ALL",
                            customComponent: Select,
                            onSelect: this.handleDementiaClick
                        },
                        {
                            id: 1,
                            name: "Dementia Only",
                            value: "YES",
                            customComponent: Select,
                            onSelect: this.handleDementiaClick
                        },
                        {
                            id: 2,
                            name: "Non Dementia Only",
                            value: "NO",
                            customComponent: Select,
                            onSelect: this.handleDementiaClick
                        },
                    ]
                },
                {
                    name: "Regions",
                    id: 3,
                    isOpen: false, 
                    customComponent: ControlIcon,
                    icon: "layers_clear",
                    depth: 0,
                    children: []
                },
                {
                    name: "Sizes",
                    id: 4,
                    isOpen: false,
                    customComponent: ControlIcon,
                    icon: "aspect_ratio",
                    depth: 0,
                    children: []
                }
            ]
        };

from react-infinity-menu.

tiansijie avatar tiansijie commented on July 20, 2024

a hundred leaf nodes should be fine. deep copy is slow, but I don't see why will causing your problem. Deep copy here mainly for usage of search

from react-infinity-menu.

Freakazo avatar Freakazo commented on July 20, 2024

It might be because of a circular reference inside a react component that deep-copy doesn't handle.

Would changing the copy library from deep-copy to the much more popular deepcopy be welcome?
That's if it actually solves the original issue and has no other side effects.

If so I will spend some time testing it and submit a pull request.

https://www.npmjs.com/package/deepcopy
https://www.npmjs.com/package/deep-copy

from react-infinity-menu.

conorhastings avatar conorhastings commented on July 20, 2024

@Freakazo that sounds like an acceptable solution!

from react-infinity-menu.

conorhastings avatar conorhastings commented on July 20, 2024

this should be resolved

from react-infinity-menu.

Related Issues (19)

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.