@react-mock/localstorage

0.1.2 • Public • Published

LocalStorage

Mock LocalStorage data declaratively.

Note: LocalStorageMock mocks the global localStorage API, so only one LocalStorageMock instance should be rendered at once.

import { LocalStorageMock } from '@react-mock/localstorage';

render(
  <LocalStorageMock items={{ sessionId: 're4lt0k3n' }}>
    <MyComponent />
  </LocalStorageMock>
);

/@react-mock/localstorage/

    Package Sidebar

    Install

    npm i @react-mock/localstorage

    Weekly Downloads

    5,994

    Version

    0.1.2

    License

    MIT

    Unpacked Size

    6.25 kB

    Total Files

    6

    Last publish

    Collaborators

    • skidding