Skip to content

firasrg/expo-msw

Repository files navigation

Expo MSW

To give support on using MSW within Expo app(s) (managed/bare) 👀.

About

Currently, has one main screen in which it shows a list of random users, with possibility to refresh.

👉 We can bring it into another dimension, like to become a useful package for Expo projects 😉.

Demo (Android)

Press here to expand 👈

Usage

Make the server:

const server = setupServer(...handlers);

export default server;

In you App.tsx (or even index file) add the following:

import "react-native-url-polyfill/auto";
import server from "./src/devServer";

server.listen({onUnhandledRequest:"bypass"});

👉 react-native-url-polyfill/auto is required, following this issue in msw repository.

Steps to run the demo

  • Clone the repo using Git command:
https://github.com/firas1220/expo-msw.git
  • Install dependencies with yarn
yarn install

or with npm:

npm install
  • Run the app using Expo command:
expo start

Supporting

We appreciate any good suggestions to make this project community-driven, so it becomes useful and powerful.

Especially for:

NOTE: If we get more examples, then we can turn this app into a real showcase with menus and categories and more 😎.

Contributing

We still at the beginning 🥺! So we need some time to see if this repo is really important to others 😅.

By the way, feel free to send your pull request, if you'd like to add some features or fix an issue.

Thank you ! 🙌

About

A repository to mock data API using msw within Expo app!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published