@seesaw/react-native-svg-web

1.0.3 • Public • Published

react-native-svg-web

npm version downloads

This package can be used as a drop-in replacement for react-native-svg when targeting the web, or as a mock for jest when testing react-native applications.

Targeting the Web

Add the following to your webpack configuration:

module.exports = {
  ..., /* the existing configuration */

  resolve: {
    alias: {
      'react-native-svg': 'react-native-svg-web'
    }
  }
};

Mocking with Jest

Add the following to your package.json.

{
  "jest": {
    "setupFiles": [
      "./jest/mocks/react-native-svg.js"
    ]
  }
};

And then create a file ./jest/mocks/react-native-svg.js:

jest.mock('react-native-svg', () => require('react-native-svg-web'));

Readme

Keywords

none

Package Sidebar

Install

npm i @seesaw/react-native-svg-web

Weekly Downloads

471

Version

1.0.3

License

none

Unpacked Size

4.03 kB

Total Files

3

Last publish

Collaborators

  • mariaines-seesaw
  • stevenlundy-seesaw
  • maygan
  • sjogreen