0.0.2 • Published 4 years ago

react-recycle-dom v0.0.2

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

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
0.0.2

4 years ago

0.0.1

4 years ago

0.0.0

4 years ago