Hello 
I am creating a Custom Plugin Panel and I need to know when a panel is in editing mode.
Some UI elements of this plugin have to be hidden in editing mode.
I couldn’t find any help in documentation.
- I’ve read things about AppEvents but I didn’t manage to use it with React.
- I’ve also tried to use document.location (if it includes “panelEdit”) but it is not updated correctly, there is still one step behind.
Is there any way to retrieve this ?
Thank you very much for your help!
Love Grafana <3
Hello,
You can import urlUtil from @grafana/data and do something like this:
const params = urlUtil.getUrlSearchParams();
if (params.editPanel != null) {
// In edit mode
}
I used it once in grafana OSS and it should work for plugins too.
Thanks a lot agnestoulet1 for your answer. I keep the solution in mind, I’ve finally managed to design my plugin to not need this information.
More than 2 years later, I was faced with this situation again! 
I’ve found at last something clean :
import { locationService } from '@grafana/runtime';
const isEditing = locationService.getSearchObject().editPanel !== undefined;
If the panel is currently editing, isEditing will be a number, otherwise it will be undefined.