File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ All notable changes to `permafrost-dev/react-ray` will be documented in this fil
4
4
5
5
---
6
6
7
+ ## 1.1.2 - 2023-May-07
8
+
9
+ - add ` useRayWithElement ` hook
10
+
7
11
## 1.1.1 - 2023-Mar-29
8
12
9
13
- support React 16+
Original file line number Diff line number Diff line change @@ -101,6 +101,28 @@ const MyComponent = () => {
101
101
![ react-ray-01] ( https://user-images.githubusercontent.com/5508707/224473546-c695914e-3919-466f-bf05-f760dac36c0f.gif )
102
102
103
103
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
+
104
126
## Setup
105
127
106
128
``` bash
You can’t perform that action at this time.
0 commit comments