Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Radium updates displayName to Radium(<component_display_name>) #271

Closed
theogravity opened this issue Jul 16, 2015 · 4 comments
Closed

Radium updates displayName to Radium(<component_display_name>) #271

theogravity opened this issue Jul 16, 2015 · 4 comments
Labels

Comments

@theogravity
Copy link

I'm trying to obtain the component's displayName. When wrapping Radium around my component, the displayName is updated to Radium(<display_name>). Is this intended? I want the original displayName.

@alexlande
Copy link
Contributor

This is intentional and is meant to give a clear indication that the component is using Radium for debugging purposes.

What's your use case for needing the original displayName?

@ianobermiller
Copy link
Contributor

I'm open to removing the "Radium(...)" wrapper around displayName. Can you image if every decorator did the same? Radium(Relay(autobound(Button))) 👎

@theogravity
Copy link
Author

We have a custom workflow that involves using react-docgen and react-styleguide-generator. We'd like to map the displayName of the loaded component to a dictionary of displayNames, which contains metadata about that component.

Could there be an option to disable altering the displayName?

@theogravity
Copy link
Author

Here's an example of what we're trying to build, and how the wrapping gets in the way:

We're using displayName to auto-generate code examples based on the props of a component.

screenshot

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants