Skip to content

makabakabu/react-recycle-dom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

use portal to recycle dom to achieve performance

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published