react-attack 1.0.6 → 1.1.1

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 +14 -70
  2. package/package.json +7 -4
package/README.md CHANGED
@@ -1,7 +1,9 @@
1
- # react-attack
1
+ # [react attack](https://npmjs.com/packages/react-attack)
2
2
 
3
3
  ![image](https://raw.githubusercontent.com/passariello/container/refs/heads/main/reactattack/reactattack.jpg)
4
4
 
5
+ [![NPM](https://nodei.co/npm/react-attack.png?stars=true&downloads=true)](https://nodei.co/npm/react-attack/)
6
+
5
7
  You can pass a react component or html element and append it where you want.
6
8
 
7
9
  **React Attack** by [Dario Passariello](https://dario.passariello.ca) (c)
@@ -10,11 +12,8 @@ You can pass a react component or html element and append it where you want.
10
12
  [![downloads](https://img.shields.io/npm/dm/react-attack.svg)](https://npmjs.org/package/react-attack)
11
13
 
12
14
  ![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)
15
+ ![React](https://img.shields.io/badge/React-gray?logo=react)
15
16
  ![ESLint](https://img.shields.io/badge/ESLint-gray?logo=eslint)
16
- ![webpack](https://img.shields.io/badge/webpack-gray?logo=webpack)
17
-
18
17
  ![License](https://img.shields.io/badge/license-MIT-blue.svg)
19
18
 
20
19
  ## install
@@ -33,19 +32,15 @@ import ReactAttack from "react-attack"
33
32
 
34
33
  ```js
35
34
 
36
- useEffect(
37
- () => {
38
- ReactAttack(
39
- "body", // <-- Append to body
40
- "component", // <-- ID of container
41
- <div>HTML</div> // <-- Example with HTML
42
- )
43
- }
35
+ ReactAttack(
36
+ "body", // <-- Append to body
37
+ "component", // <-- ID of container
38
+ <div>HTML</div> // <-- Example with HTML
44
39
  )
45
40
 
46
- or
41
+ or using a component
47
42
 
48
- // Create a component on-fly as Test + useState!
43
+ // You create a component on-fly as Test + useState!
49
44
  const TestComponent = () => {
50
45
  const [test, setTest] = useState("Hello World")
51
46
  return (
@@ -55,61 +50,10 @@ import ReactAttack from "react-attack"
55
50
  )
56
51
  }
57
52
 
58
- useEffect(
59
- () => {
60
- ReactAttack(
61
- "body", // <-- Append to body
62
- "component", // <-- ID of container
63
- <TestComponent /> // <-- React Component
64
- )
65
- }
53
+ ReactAttack(
54
+ "body", // <-- Append to body
55
+ "component", // <-- ID of container
56
+ <TestComponent /> // <-- React Component
66
57
  )
67
58
 
68
59
  ```
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
- },[]
106
- )
107
-
108
- return null
109
- }
110
-
111
-
112
- ```
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.1",
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": {