react-attack 1.0.1 → 1.0.3

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 CHANGED
@@ -9,10 +9,9 @@ npm i -D react-attack
9
9
  ```
10
10
 
11
11
  You use:
12
- If your app is an SPA you need to import only one time at first script
13
12
 
14
13
  ```javascript
15
- import "react-attack"
14
+ import ReactAttack from "react-attack"
16
15
  ```
17
16
 
18
17
  ## how works and use
@@ -21,7 +20,7 @@ import "react-attack"
21
20
 
22
21
  useEffect(
23
22
  () => {
24
- ReactGlue(
23
+ ReactAttack(
25
24
  "body", // <-- Append to body
26
25
  "component", // <-- ID of container
27
26
  <div>HTML</div> // <-- Example with HTML
@@ -43,7 +42,7 @@ import "react-attack"
43
42
 
44
43
  useEffect(
45
44
  () => {
46
- ReactGlue(
45
+ ReactAttack(
47
46
  "body", // <-- Append to body
48
47
  "component", // <-- ID of container
49
48
  <TestComponent /> // <-- React Component
@@ -60,14 +59,14 @@ import "react-attack"
60
59
  // Example in React to create a popup into body
61
60
 
62
61
  import React from "react"
63
- import ReactGlue from "react-attack"
62
+ import ReactAttack from "react-attack"
64
63
 
65
64
  const MyFunction = () =>{
66
65
 
67
66
  useEffect(
68
67
  () => {
69
68
 
70
- ReactGlue(
69
+ ReactAttack(
71
70
  "body",
72
71
  "component",
73
72
  <div
package/index.d.ts CHANGED
@@ -5,9 +5,9 @@
5
5
  https://dario.passariello.ca
6
6
  */
7
7
 
8
- declare module 'ReactGlue'
8
+ declare module 'ReactAttack'
9
9
 
10
- declare var ReactGlue
11
- type ReactGlue = {}
10
+ declare var ReactAttack
11
+ type ReactAttack = {}
12
12
 
13
- export default ReactGlue
13
+ export default ReactAttack
package/index.tsx CHANGED
@@ -1 +1 @@
1
- import r,{isValidElement as i}from"react";import{createRoot as d}from"react-dom/client";const a=(o,c,e)=>{const t=document.createElement("div");t.id=c;const n=document.querySelector(o);if(!n)throw"React Glue need the parent object in the scene";const l=n.appendChild(t);d(t).render(i(e)?e:r.createElement(r.Fragment,null,e))};export default a;
1
+ import r,{isValidElement as i}from"react";import{createRoot as a}from"react-dom/client";const d=(c,o,e)=>{const t=document.createElement("div");t.id=o;const n=document.querySelector(c);if(!n)throw"React Glue need the parent object in the scene";const m=n.appendChild(t);a(t).render(i(e)?e:r.createElement(r.Fragment,null,e))};export default d;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-attack",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Render React where you want",
5
5
  "keywords": [
6
6
  "react-attack, react, render, component, glue, dario, passariello"