getCurrentInstance
When you are using tarojs to develop your mini program, sometimes query is incorrect with the api getCurrentInstance. Make sure the getCurrentInstance is inside the useDidShow hook
tarojs
CodeuseDidShow(() => { const query = getCurrentInstance().router.params; });
useDidShow(() => { const query = getCurrentInstance().router.params; });