jquery-react-render 1.1.5 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,22 @@
|
|
|
1
|
-
# jquery-react-render
|
|
1
|
+
# jquery-react-render (aka jrr)
|
|
2
2
|
|
|
3
3
|
If you love to use Jquery and react... this is for you!
|
|
4
4
|
You can pass a react component or html element and append it where you want... in react style
|
|
5
5
|
|
|
6
|
+
**jquery-react-render** by [Dario Passariello](https://dario.passariello.ca) (c)
|
|
7
|
+
|
|
8
|
+
[](https://npmjs.org/package/jquery-react-render)
|
|
9
|
+
[](https://npmjs.org/package/jquery-react-render)
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+

|
|
13
|
+

|
|
14
|
+

|
|
15
|
+
|
|
16
|
+

|
|
17
|
+
|
|
18
|
+
> NOTE: if you have intention to use exclusively in react please, use ["REACT-ATTACK"](https://www.npmjs.com/package/react-attack) instead.
|
|
19
|
+
|
|
6
20
|
## install
|
|
7
21
|
|
|
8
22
|
```sh
|
|
@@ -12,20 +26,46 @@ npm i -D jquery-react-render
|
|
|
12
26
|
You use:
|
|
13
27
|
If your app is an SPA you need to import only one time at first script
|
|
14
28
|
|
|
15
|
-
```
|
|
29
|
+
```js
|
|
16
30
|
import "jquery-react-render"
|
|
17
31
|
```
|
|
18
32
|
|
|
19
|
-
##
|
|
33
|
+
## Example in vanilla js
|
|
20
34
|
|
|
21
|
-
```
|
|
35
|
+
```js
|
|
22
36
|
|
|
23
|
-
$("body").react(
|
|
24
|
-
"#
|
|
25
|
-
<div
|
|
26
|
-
|
|
37
|
+
$("body").react( // The main element where you want you component
|
|
38
|
+
"#jrr", // example: the name of container
|
|
39
|
+
<div>
|
|
40
|
+
This is just a test
|
|
27
41
|
</div>
|
|
28
|
-
)
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Example in React
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
|
|
50
|
+
import react from "React"
|
|
51
|
+
import "jquery-react-render"
|
|
52
|
+
|
|
53
|
+
export const Test = () => {
|
|
54
|
+
|
|
55
|
+
useEffect(
|
|
56
|
+
()=>{
|
|
57
|
+
$("body").react( // The main element where you want you component
|
|
58
|
+
"#jrr", // example: the name of container
|
|
59
|
+
<div>
|
|
60
|
+
This is just a test
|
|
61
|
+
</div>
|
|
62
|
+
)
|
|
63
|
+
},[]
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
return <div>TEST</div>
|
|
67
|
+
|
|
68
|
+
}
|
|
29
69
|
|
|
30
70
|
```
|
|
31
71
|
|