react-dom-super-render
v1.0.1
Published
enhance ReactDom.render method
Downloads
1
Readme
react-dom-super-render
enhance ReactDom.render method
Install
npm install --save react-dom-super-render
Usage
index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<title>react-dom-super-render</title>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
</body>
</html>
index.js
import React from 'react'
import ReactDOM from 'react-dom'
import App from './App'
import ReactDomRender from 'react-dom-super-render'
//second argument is enum
//type secondArg = "before" | "after" | "append" | "prepend" | "replaceWith";
//default value "replaceWith"
const superRender = ReactDomRender(ReactDOM.render,'replaceWith')
superRender(<App />, root)