Skip to content

Commit b4590d5

Browse files
authored
Added a JavaScript example to the README
1 parent 87bc310 commit b4590d5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ react-context-session is designed to minimize the number of rerenders, but still
55
With one generic `useSession` hook, and one context provider `<ProvideSession />`, you will be up and ready to go, using your own session data structure.
66
The session state dispatcher makes sure that only the requested session data properties will cause the necessary side effects and rerendering.
77

8+
This library also works with JavaScript projects. [See a more about this in "Getting started".](#getting-started)
9+
810
## Install
911

1012
```bash
@@ -13,6 +15,8 @@ npm install --save @peteck/react-context-session
1315

1416
## Getting started
1517

18+
The example below is written in TypeScript. [See this codesandbox for a JavaScript example.](https://codesandbox.io/s/admiring-rgb-n1xn6)
19+
1620
```tsx
1721
import React from "react";
1822
import { ProvideSession, useSession } from "react-context-session";

0 commit comments

Comments
 (0)