0.0.2 • Published 5 years ago
react-recycle-dom v0.0.2
react-recycle-dom
use portal to recycle dom to achieve performance
install
yarn add react-recycle-dom
how to use
bind Provider at the top level of the recycle dom and use inside it with Portal.Item name in eveywhere
import {Provider, Portal} from "react-recycle-dom";
import React from 'react';
import Item from './Item';
function App() {
return (
<Provider
componentMap={{
Item,
}}
>
<Portal.Item color='blue' />
<Portal.Item color='red' />
</Provider>
);
}
export default App;
demo
https://codesandbox.io/s/react-recycle-dom-i4di7
Prefer run demo in code?
cd example/basicUsage
yarn start
todo
- type
- demo
- test
- ci cd