Making shallow copy of popInConfiguration to avoid reference of const config. Actually, when we use position: relative on popInConfiguration. The config.x and config.y will be increment exponentially due to this copy of reference instead of shallow copy, because each time we reuse const configit will save the same value of previous iteration and increment it to the user position.
Making shallow copy of popInConfiguration to avoid reference of
const config
. Actually, when we useposition: relative
on popInConfiguration. Theconfig.x
andconfig.y
will be increment exponentially due to this copy of reference instead of shallow copy, because each time we reuseconst config
it will save the same value of previous iteration and increment it to the user position.