react-attack
v1.4.0
Published
Append your component in any part of your html using react-attack
Maintainers
Readme
react attack

You can pass a react component or html element and append it where you want.
React Attack by Dario Passariello (c)
install
npm i -D react-attackYou use:
import "react-attack"
// one time only at top of your application (example global or app)how works and use
Name change from "ReactAttack" to "reactAttack" <----
reactAttack(
"body", // <-- Append to body
"component", // <-- ID of container
<div>HTML</div> // <-- Example with HTML
)
or using a component
// You create a component on-fly as Test + useState!
const TestComponent = () => {
const [test, setTest] = useState("Hello World")
return (
<div>
<h1>{test}</h1>
</div>
)
}
reactAttack(
"body", // <-- Append to body
"component", // <-- ID of container
<TestComponent /> // <-- React Component
)
