const Button = myFunc();
Now from inside myFunc, I want to get the string "Button" (even before it is assigned to it). Is that possible?
Edit:
I see a lot of comments asking why this is even needed.
I'm creating a React component by extending an existing component and adding styles to it (via a new style element at the document head). I want the new class to be called by ".RedButton", for example:
const RedButton = extend(Button)`
color: red;
`;
...
const extend = OriginalComponent => {
const newComponentName = ... // Here I need the use of "RedButton"
...
};