babel-plugin-react-observer-displayname
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

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)';
}

Readme

Keywords

none

Package Sidebar

Install

npm i babel-plugin-react-observer-displayname

Weekly Downloads

150

Version

0.0.2

License

Apache-2.0

Unpacked Size

16.8 kB

Total Files

13

Last publish

Collaborators

  • meyer