Skip to content

Commit 626d1a2

Browse files
authored
Update README.md
1 parent 60c8b5c commit 626d1a2

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,31 @@ import { ContextDevTool } from 'react-context-devtool';
8585

8686
```
8787

88+
## Set Display name in Auto Mode
89+
90+
### Set Display name for Context API
91+
92+
- set `dispayName` props in `Provider`
93+
94+
```js
95+
<MyContext.Provider value={{ a: 'hello', b: 'world' }} displayName="Context Display Name">
96+
<YourComponent />
97+
</MyContext.Provider>
98+
```
99+
100+
or
101+
102+
- assign display name in Context
103+
104+
```js
105+
MyContext.displayName = "Context Display Name";
106+
```
107+
108+
### Set Display name for useReducer
109+
110+
- reducer function name is use as displayName in debug
111+
112+
88113
## Disable in production mode
89114

90115
```js

0 commit comments

Comments
 (0)