Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/meyer/babel-plugin-react-createcontext-displayname

Add a displayName value to createContext calls
https://github.com/meyer/babel-plugin-react-createcontext-displayname

Last synced: about 1 month ago
JSON representation

Add a displayName value to createContext calls

Awesome Lists containing this project

README

        

# babel-plugin-react-createcontext-displayname
A simple babel plugin that adds `displayName` values to `createContext` calls.

In:

```typescript
const MyContext = createContext();
```

Out:

```typescript
const MyContext = createContext();
if (process.env.NODE_ENV === 'development') {
MyContext.displayName = 'MyContext';
}
```