Repository: plotly/dash
File: dash/dash-renderer/src/TreeContainer.js (JavaScript)

Code before:

        const element = Registry.resolve(_dashprivate_layout);

        // Hydrate components props
        const childrenProps = pathOr(
            [],
            [
                'children_props',
                _dashprivate_layout.namespace,
                _dashprivate_layout.type
            ],
            _dashprivate_config
        );
        let props = dissoc('children', _dashprivate_layout.props);

        for (let i = 0; i < childrenProps.length; i++) {
            const childrenProp = childrenProps[i];

            const handleObject = (obj, opath) => {
                return keys(obj).reduce((acc, k) => {
                    const node = acc[k];
                    return {
                        ...acc,
                        [k]: this.wrapChildrenProp(node, [...opath, k])
                    };
                }, obj);
            };

            if (childrenProp.includes('.')) {
                let path = childrenProp.split('.');
                let node;
                let nodeValue;
                if (childrenProp.includes('[]')) {
                    let frontPath = [],
                        backPath = [],
                        found = false,
                        hasObject = false;
                    path.forEach(p => {
                        if (!found) {
                            if (p.includes('[]')) {
                                found = true;
                                if (p.includes('{}')) {
                                    hasObject = true;
                                    frontPath.push(
                                        p.replace('{}', '').replace('[]', '')
                                    );
                                } else {
                                    frontPath.push(p.replace('[]', ''));
                                }
                            } else if (p.includes('{}')) {
                                hasObject = true;

Review comment (suggestion):
If I'm understanding this correctly:
```suggestion
                return mapObjIndexed(
                    (node, k) => this.wrapChildrenProp(node, [...opath, k]),
                    obj
                );
```

Code after:

        const element = Registry.resolve(_dashprivate_layout);

        // Hydrate components props
        const childrenProps = pathOr(
            [],
            [
                'children_props',
                _dashprivate_layout.namespace,
                _dashprivate_layout.type
            ],
            _dashprivate_config
        );
        let props = dissoc('children', _dashprivate_layout.props);

        for (let i = 0; i < childrenProps.length; i++) {
            const childrenProp = childrenProps[i];

            const handleObject = (obj, opath) => {
                return mapObjIndexed(
                    (node, k) => this.wrapChildrenProp(node, [...opath, k]),
                    obj
                );
            };

            if (childrenProp.includes('.')) {
                let path = childrenProp.split('.');
                let node;
                let nodeValue;
                if (childrenProp.includes('[]')) {
                    let frontPath = [],
                        backPath = [],
                        found = false,
                        hasObject = false;
                    path.forEach(p => {
                        if (!found) {
                            if (p.includes('[]')) {
                                found = true;
                                if (p.includes('{}')) {
                                    hasObject = true;
                                    frontPath.push(
                                        p.replace('{}', '').replace('[]', '')
                                    );
                                } else {
                                    frontPath.push(p.replace('[]', ''));
                                }
                            } else if (p.includes('{}')) {
                                hasObject = true;
                                frontPath.push(p.replace('{}', ''));
                            } else {
                                frontPath.push(p);