0.1.3 • Published 1 month ago

msw-rn-wrapper v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

MSW React Native Wrapper

A convenient wrapper for MSW (Mock Service Worker) with React Native support.

Features

  • Dynamic Mock Scenarios
  • Seamless react native integration
  • In-place database store with read/write access.

Pre-requisites

  1. Add the following plugins to babel.config.js:
'@babel/plugin-transform-flow-strip-types',
['@babel/plugin-transform-private-methods', { loose: true }],
  1. In your entry file, add import 'msw-rn-wrapper';

Installation

npm install msw-rn-wrapper
or
yarn add msw-rn-wrapper

Usage

import { MSWProvider } from 'msw-rn-wrapper';

<MSWProvider enabled={true}>
  {' '}
  // Should be enabled based on env // ...
</MSWProvider>;

To activate the mock service worker during development, use ⌃⌘Z and select View MSW Settings.

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Written for use by @PLT (PrettyLittleThing).