react-attack 1.0.6 → 1.1.0
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 +11 -69
- package/package.json +7 -4
package/README.md
CHANGED
|
@@ -10,11 +10,8 @@ You can pass a react component or html element and append it where you want.
|
|
|
10
10
|
[](https://npmjs.org/package/react-attack)
|
|
11
11
|
|
|
12
12
|

|
|
13
|
-

|
|
13
|
+

|
|
15
14
|

|
|
16
|
-

|
|
17
|
-
|
|
18
15
|

|
|
19
16
|
|
|
20
17
|
## install
|
|
@@ -33,19 +30,15 @@ import ReactAttack from "react-attack"
|
|
|
33
30
|
|
|
34
31
|
```js
|
|
35
32
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"component", // <-- ID of container
|
|
41
|
-
<div>HTML</div> // <-- Example with HTML
|
|
42
|
-
)
|
|
43
|
-
}
|
|
33
|
+
ReactAttack(
|
|
34
|
+
"body", // <-- Append to body
|
|
35
|
+
"component", // <-- ID of container
|
|
36
|
+
<div>HTML</div> // <-- Example with HTML
|
|
44
37
|
)
|
|
45
38
|
|
|
46
|
-
or
|
|
39
|
+
or using a component
|
|
47
40
|
|
|
48
|
-
//
|
|
41
|
+
// You create a component on-fly as Test + useState!
|
|
49
42
|
const TestComponent = () => {
|
|
50
43
|
const [test, setTest] = useState("Hello World")
|
|
51
44
|
return (
|
|
@@ -55,61 +48,10 @@ import ReactAttack from "react-attack"
|
|
|
55
48
|
)
|
|
56
49
|
}
|
|
57
50
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"component", // <-- ID of container
|
|
63
|
-
<TestComponent /> // <-- React Component
|
|
64
|
-
)
|
|
65
|
-
}
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
## React Example
|
|
71
|
-
|
|
72
|
-
```js
|
|
73
|
-
|
|
74
|
-
// Example in React to create a popup into body
|
|
75
|
-
|
|
76
|
-
import React from "react"
|
|
77
|
-
import ReactAttack from "react-attack"
|
|
78
|
-
|
|
79
|
-
const MyFunction = () =>{
|
|
80
|
-
|
|
81
|
-
useEffect(
|
|
82
|
-
() => {
|
|
83
|
-
|
|
84
|
-
ReactAttack(
|
|
85
|
-
"body",
|
|
86
|
-
"component",
|
|
87
|
-
<div
|
|
88
|
-
className="modal"
|
|
89
|
-
style={
|
|
90
|
-
{
|
|
91
|
-
position:"absolute",
|
|
92
|
-
background:"white",
|
|
93
|
-
top:"20px",
|
|
94
|
-
left:"20px",
|
|
95
|
-
width:"300px",
|
|
96
|
-
height:"300px",
|
|
97
|
-
zIndex: 10,
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
>
|
|
101
|
-
Hello World
|
|
102
|
-
</div>
|
|
103
|
-
)
|
|
104
|
-
|
|
105
|
-
},[]
|
|
51
|
+
ReactAttack(
|
|
52
|
+
"body", // <-- Append to body
|
|
53
|
+
"component", // <-- ID of container
|
|
54
|
+
<TestComponent /> // <-- React Component
|
|
106
55
|
)
|
|
107
56
|
|
|
108
|
-
return null
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
57
|
```
|
|
113
|
-
|
|
114
|
-
Copyright by Dario Passariello (c) 2025
|
|
115
|
-
all rights reserved - <dariopassariello@gmail.com>
|
package/package.json
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-attack",
|
|
3
|
-
"version": "1.0
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Append your component in any part of your html using react-attack",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-attack",
|
|
7
7
|
"react",
|
|
8
8
|
"attack",
|
|
9
9
|
"render",
|
|
10
10
|
"component",
|
|
11
|
-
"
|
|
11
|
+
"append",
|
|
12
|
+
"html",
|
|
13
|
+
"element",
|
|
14
|
+
"body",
|
|
12
15
|
"dario",
|
|
13
16
|
"passariello"
|
|
14
17
|
],
|
|
15
18
|
"license": "MIT",
|
|
16
19
|
"author": "Dario Passariello",
|
|
17
|
-
"type": "
|
|
20
|
+
"type": "module",
|
|
18
21
|
"main": "./index.tsx",
|
|
19
22
|
"types": "./index.d.ts",
|
|
20
23
|
"dependencies": {
|