Skip to content

Commit 0eef87c

Browse files
committed
update docs
1 parent 47439a7 commit 0eef87c

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to `permafrost-dev/react-ray` will be documented in this fil
44

55
---
66

7+
## 1.1.2 - 2023-May-07
8+
9+
- add `useRayWithElement` hook
10+
711
## 1.1.1 - 2023-Mar-29
812

913
- support React 16+

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,28 @@ const MyComponent = () => {
101101
![react-ray-01](https://user-images.githubusercontent.com/5508707/224473546-c695914e-3919-466f-bf05-f760dac36c0f.gif)
102102

103103

104+
### `useRayInstance()`
105+
106+
To access the Ray instance directly, use the `useRayInstance` hook:
107+
108+
```js
109+
import { useRayInstance } from 'react-ray';
110+
111+
const MyComponent = () => {
112+
const ray = useRayInstance();
113+
114+
ray('hello world');
115+
116+
return (
117+
<div>
118+
<button onClick={() => ray('hello world')}>
119+
Click me
120+
</button>
121+
</div>
122+
);
123+
};
124+
```
125+
104126
## Setup
105127

106128
```bash

0 commit comments

Comments
 (0)