react-stamp
react-stamp copied to clipboard
Automatically setting displayName for a component
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.
I am definitely on board with automatically setting displayName
. Feel free to propose changes in a PR.