-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Description
Got the problem with stateless components. As you suggest here, I've just wrapped component declaration into observer(..)
function like this:
export const MyButton = observer( ({ param }) => (
<div>......</div>
));
but that breaks up displayName
of this component. So I see smth like this (without observer(...)
displayName
is displayed properly):
for now, first solution that I see is to export default
const MyButton = ({ param }) => (
<div>......</div>
);
export default observer(MyButton);
But then I'm able to export only one thing from module. Other way is to create two variables like MyButton
and then export const MyButtonObserver = observer(MyButton)
--- but that is unpleasant complication(((
Is there any other way to fix this? Should this be reflected in docs?
Metadata
Metadata
Assignees
Labels
No labels