GitXplorerGitXplorer
V

react-native-webfills

public
4 stars
1 forks
0 issues

Commits

List of commits on branch master.
Unverified
78408663704739a1170746f85dca24e84cde00b4

Fix token validity

VVinceBT committed 7 years ago
Unverified
6c16f73f28223ce0d7c3ad7f2fe04c2762db53e4

Added RNFirebase

VVinceBT committed 7 years ago
Unverified
8076a78ee9a61a219a5d827361ae0dc67ff03eec

Quick fix

VVinceBT committed 7 years ago
Unverified
f12d90a90877a25412f7544eda84d7e4dd628dee

Quick fix

VVinceBT committed 7 years ago
Unverified
8d3e4f3beb0239a963a7698f2207bfdbce136ebf

Support for react-native-version-number

VVinceBT committed 7 years ago
Unverified
d93b1ec9f0d3a74a3afead59098f43ad2a49e126

Added default image upload to ImagePicker

VVinceBT committed 7 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