Skip to content

Commit 38ccd9a

Browse files
authored
Update README.md
1 parent 959a443 commit 38ccd9a

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

README.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ https://reactcommunity.org/react-tabs/example/
3030
3131
(TODO: This demos are outdated and use super old versions of react and react-tabs)
3232
33-
## Usage
34-
35-
### Basic Example
33+
## Basic Example
3634
3735
```js
3836
import { Tab, Tabs, TabList, TabPanel } from 'react-tabs';
@@ -54,7 +52,22 @@ export default () => (
5452
);
5553
```
5654
57-
### Components
55+
## API
56+
57+
### resetIdCounter(): void
58+
59+
Allows reseting the internal id counter which is used to generate unique id's for tabs and tab panels.
60+
61+
You should never need to use this in the browser. Only if you are running a isomorphic react app that is rendered on the server you should call `resetIdCounter()` before every render so that the ids that get generated on the server match the ids generated in the browser.
62+
63+
```js
64+
import { resetIdCounter } from 'react-tabs';
65+
66+
resetIdCounter();
67+
ReactDOMServer.renderToString(...);
68+
```
69+
70+
## Components
5871
5972
react-tabs consists of 4 components which all need to be used together.
6073

0 commit comments

Comments
 (0)