Skip to content
This repository has been archived by the owner on Jun 21, 2019. It is now read-only.

Automatically setting displayName for a component #40

Open
danielkcz opened this issue Jul 5, 2016 · 1 comment
Open

Automatically setting displayName for a component #40

danielkcz opened this issue Jul 5, 2016 · 1 comment

Comments

@danielkcz
Copy link
Contributor

danielkcz commented Jul 5, 2016

Just an idea, I'm not sure if it doesn't collide with something else at this point, but what about defining component like this:

const MyComponent = () => ({
    render() {
    }
});
export default ReactStamp.compose(
    MyComponent, Focusable, Emittable
);

It means that it would have to call passed function to a compose to obtain a descriptor. Along the way it would be possible to read displayName of that function and append into final descriptor. I also like it this way as final composition is more readable.

@troutowicz
Copy link
Member

I am definitely on board with automatically setting displayName. Feel free to propose changes in a PR.

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

No branches or pull requests

2 participants