How to perform the render with a delay?

I have code like this
export class Node extends Component {
 renderChild = childId => {
 const { id } = this.props;

 return (
 <li key="{childId}">
 <connectednode id="{childId}" parentid="{id}">
</connectednode></li>
)
};

 render() {
 const { parentId, childIds, type, _value, _key } = this.props;
 return (
the <div>
 {type == 'object' && _value & & < / span>{</span>}
 {type == 'object' && !_value & & < / span><b>{_key} :</b> {</span>}
 {type == 'array' & & < / span><b>{_key} :</b> [</span>}
 {type == 'object array' & & < / span>{</span>}
 {type == 'string' & & < / span><b>{_key} :</b>{_value}</span>}

 {childIds.length & & a <ul style="{{listStyle:" 'none', paddingleft: '24px'}}>
{childIds.map(this.renderChild)}
</ul>}

 {type == 'object' & & < / span> }</span>}
 {type == 'object array' & & < / span> }</span>}
 {type == 'array' && <span>]</span>}
</div>
)
}
}

mapStateToProps function(state, ownProps) {
 return state.entity.structure[ownProps.id]
}

const ConnectedNode = connect(mapStateToProps, actions)(Node);
export default ConnectedNode;


I need to render with a delay built. The point is that when the recursion is very large the browser eventually freezes. so I think to lighten the load, making the minimum download
July 4th 19 at 23:01
1 answer
July 4th 19 at 23:03
setTimeout(()=>{
 //Code - context tied using the arrow function
}, 5000)

Find more questions by tags JavaScriptReactRedux