babel-plugin-react-observer-displayname
v0.0.2
Published
A simple babel plugin that adds `displayName` values to `observer` calls.
Downloads
1,418
Readme
babel-plugin-react-observer-displayname
A simple babel plugin that adds displayName
values to observer
calls.
Useful if you use mobx-react-lite
. Probably not useful if you don’t.
In:
const MyComponent = observer(props => {
// ...
});
Out:
const MyComponent = observer(props => {
// ...
});
if (process.env.NODE_ENV === 'development') {
MyComponent.displayName = 'observer(MyComponent)';
}