Skip to content

Latest commit

 

History

History
39 lines (24 loc) · 718 Bytes

README.md

File metadata and controls

39 lines (24 loc) · 718 Bytes

React Hooks Data Structures

The purpose of this project is to bring you basic data structures through React hooks.

Installation

Use the package manager npm to install react-hooks-data-structures.

npm i react-hooks-data-structures

Usage

import { useLinkedList } from 'react-hooks-data-structures/LinkedList';


const SomeComponent = (props) => {
  const linkedList = useLinkedList();

  const handleClick = useCallback((evt) => {
    linkedList.add(evt.target.value);
  }, []);

  return (
    <>
      {linkedList.map((value, idx) => <Item key={idx}>{value}</Item>)}
    </>
  )
}

License

MIT