GitXplorerGitXplorer
V

react-native-webfills

public
4 stars
1 forks
0 issues

Commits

List of commits on branch master.
Unverified
317b931d81759f84524ce9fc5e23e519e3ab724a

Added resize timeout for ViewPager

VVinceBT committed 7 years ago
Unverified
cc9d7d6528466def4e9d5206797103ba0bf5a758

Added stub for react-native-image-picker

VVinceBT committed 7 years ago
Unverified
455ba5ada9c8c795d8db1d4ab176df56c3825547

Added support for RN18n

VVinceBT committed 7 years ago
Unverified
ab01fbe93d3dabe691bd3f0e62fcac32aa94586f

Many stubs added

VVinceBT committed 7 years ago
Unverified
a9ca51b1114735ea626c898c25a4f1580e0f10fa

Fix for MIcons

VVinceBT committed 8 years ago
Unverified
886ddcac09ce1c2e0bf1b2e5171a1803c94194ba

Added LICENSE

VVinceBT committed 8 years ago

README

The README file for this repository.

React Native Webfills

Webfills for useful packages of React Native so they can be used on React Native Web

Collaboration

Feel free to make PRs to fix stuff or add new supported packaged

Currently supported

  • react-native-blur => Stub, doing nothing
  • react-native-drawer-layout => Fully working
  • react-native-linear-gradient => Fully working
  • react-native-maps => A bit glitchy, MapView, Marker, Circle and Polylines implemented

NOTE: Add this line to your index.html before your bundle.js :

<script src="//maps.google.com/maps/api/js?key=MYGOOGLEAPIKEY" type="text/javascript"></script>
  • react-native-i18n => Working, just install i18n-js beside
  • react-native-photo-view => Stub, doing nothing
  • react-native-modal-datetime-picker => Stub, doing nothing
  • react-native-vector-icons => Only MaterialIcons and MaterialCommunityIcons

NOTE: Respective instructions can be found in each index.js file

  • react-native-view-pager => Fully working without swipe gestures`obviously
  • react-native-version-number => Fully working, instructions for setup in the index.js)

Usage

This module is made to be cloned as a submodule named webfills in your webpack project.

git submodule add https://github.com/VinceBT/react-native-webfills.git webfills
git submodule update --init --recursive

Then add this to your webpack.config.js :

const fs = require('fs');
const path = require('path');

const webfillsFolder = 'webfills';

const aliases = {
  'react-native': 'react-native-web',
  'react-router-native': 'react-router',
};

fs.readdirSync(webfillsFolder).filter(f => fs.statSync(`${webfillsFolder}/${f}`).isDirectory()).forEach(mod => {
  console.log(`Webfill detected: ${mod}`);
  aliases[mod] = path.join(__dirname, webfillsFolder, mod);
});

...

module.exports = {
  ...
  resolve: {
    alias: aliases,
  },
  ...
}

License

MIT