“default“ keyword not allows property pane to open

"Default" predefined keyword error

In this blog post, we will see what happens when we use some predefined keyword in SharePoint, and it generates an error that we can not get easily at that point, what should be done.

While working with SharePoint or SPFx, we use the mystrings.d.ts file to add strings to show as a display name, label, or title. But when we use some predefined keywords, it leads to the point where we can not get the exact issue, and it also does not show an error in the terminal or browser. So what should we do?

In my case, when I was working with SPFx, I used the default keyword in the mystrings.d.ts file, and when I rendered my web part, that led to me that point when I was not able to find the exact issue. I used default keyword in mystrings.d.ts file and use it in my web-part property pane. After rendered my web-part when I tried to open property pane it was not open.

Just because of the default keyword it would be better that when you are facing some issue like this check once that you are no using predefined keyword.

In these above pictures, you can see that my property pane is not open even when I am clicking through,

to solve this, I just use the defaultValue keyword instead of default like,

This solved my issue and worked fine.

Conclusion

In this blog post, we have seen that sometimes, unknowingly, we use predefined keywords, which leads us to the point where we neither get issues in the terminal nor at run time or browser, so we just check these cases once.