Using @displayName breaks automatic component import
See original GitHub issueCurrent behavior
After adding an @displayName jsdoc item to the comment it successfully uses the provided name in the left menu as I would expect.
It also uses that new name in the component import code (I think). This causes “component undefined” errors in the console and none of the demo’s on that page load correctly.
To reproduce
Add @displayName to a component that doesn’t match the components existing name.
Expected behavior
The left menu text to update and all other functionality to remain the same.
Issue Analytics
- State:
 - Created 4 years ago
 - Comments:7 (4 by maintainers)
 
Top Results From Across the Web
displayName not working, component appearing twice story ...
Component tag names are appearing twice and ignoring displayName settings. I've set displayName to 'TestButton', and the local story source ...
Read more >Forwarding Refs - React
Ref forwarding is a technique for automatically passing a ref through a component to one of its children. This is typically not necessary...
Read more >Tooling - styled-components
It also allows you to see the component's displayName in React DevTools. For example, consider writing a styled component that renders a button...
Read more >Top 5 @material-ui/utils Code Examples - Snyk
(!name) { // Provide a better DX outside production. const displayName = getDisplayName(Component); if (displayName !== undefined) { classNamePrefix = displayName ...
Read more >React integration - MobX
using React context. Observables can be passed into components as props (as in the example above): import { observer } from "mobx-react-lite"
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thank you @rfrey-imb I think you just put your finger on the reason this issue is not closed yet.
@T0RAT0RA that’s awesome!
Would you be open to documenting it in the cookbook? It would probably help anybody find the answer they seek.
If you are, fork the project, open the Cookbook.md file and add this story to the end. You can use the question: “How to use a different name for components in the sidebar and in examples?”
or whatever you feel like.
Thank you much!
Bart
[EDIT]
Here is the link to the cookbook: https://github.com/vue-styleguidist/vue-styleguidist/blob/dev/docs/docs/Cookbook.md