I always set displayName to the same name as the variable to which I assign it. This will only be used in development builds, as it is removed by eliminating dead code in production builds and should not rely on your application.
As for where it is used, this mainly happens when exchanging error messages. This is why it is referred to as useful for debugging. If no name can be obtained, the default error messages say Component , which are extremely difficult to debug if your project has more than one component.
Here are some error messages that reference displayName in the response source:
Invalid return
Inline style error
source share