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.
Files changed (2) hide show
  1. package/README.md +11 -69
  2. 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
  [![downloads](https://img.shields.io/npm/dm/react-attack.svg)](https://npmjs.org/package/react-attack)
11
11
 
12
12
  ![TypeScript](https://img.shields.io/badge/TypeScript-gray?logo=typescript)
13
- ![Node.js](https://img.shields.io/badge/Node.js-gray?logo=node.js)
14
- ![Jest](https://img.shields.io/badge/Jest-gray?logo=jest)
13
+ ![React](https://img.shields.io/badge/React-gray?logo=react)
15
14
  ![ESLint](https://img.shields.io/badge/ESLint-gray?logo=eslint)
16
- ![webpack](https://img.shields.io/badge/webpack-gray?logo=webpack)
17
-
18
15
  ![License](https://img.shields.io/badge/license-MIT-blue.svg)
19
16
 
20
17
  ## install
@@ -33,19 +30,15 @@ import ReactAttack from "react-attack"
33
30
 
34
31
  ```js
35
32
 
36
- useEffect(
37
- () => {
38
- ReactAttack(
39
- "body", // <-- Append to body
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
- // Create a component on-fly as Test + useState!
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
- useEffect(
59
- () => {
60
- ReactAttack(
61
- "body", // <-- Append to body
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.6",
4
- "description": "Render React where you want",
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
- "glue",
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": "commonjs",
20
+ "type": "module",
18
21
  "main": "./index.tsx",
19
22
  "types": "./index.d.ts",
20
23
  "dependencies": {