Manipulate scopedVars from panel plugin react

Hello guys,
I’ve developed plugin, where I have query with some variables from dashboard. I can manipulate them with getLocationSrv().update() but it takes time and also throws a RangeError: Maximum call stack size exceeded.

My question is how can I set scopedVars from react panel plugin?
Thanks