react-native-indicators
react-native-indicators copied to clipboard
Does not compile with react-native-web
trafficstars
Recreate
create-react-native-app rn-app-web --with-web-support
cd rn-app-web
yarn add react-native-indicators
App.js
import React from 'react';
import { UIActivityIndicator } from 'react-native-indicators'
add the module to webpack.config.js
const babelLoaderConfiguration = {
test: /\.js$/,
// Add every directory that needs to be compiled by Babel during the build.
include: [
path.resolve(appDirectory, 'src'),
path.resolve(appDirectory, 'node_modules/react-navigation'),
path.resolve(appDirectory, 'node_modules/react-native-tab-view'),
path.resolve(appDirectory, 'node_modules/react-native-paper'),
path.resolve(appDirectory, 'node_modules/react-native-vector-icons'),
path.resolve(appDirectory, 'node_modules/react-native-safe-area-view'),
path.resolve(appDirectory, 'node_modules/@expo/samples'),
path.resolve(appDirectory, 'node_modules/@expo/vector-icons'),
path.resolve(appDirectory, 'node_modules/react-native-platform-touchable'),
path.resolve(appDirectory, 'node_modules/react-native-pose'),
path.resolve(appDirectory, 'node_modules/react-native-indicators'),
Then compile
yarn web
Error
ERROR in ./node_modules/react-native-indicators/src/components/indicator/index.js
Module not found: Error: Can't resolve 'react-native/package' in '/Users/chandra/Gabe/Jamie/hectare-app/node_modules/react-native-indicators/src/components/indicator'
@ ./node_modules/react-native-indicators/src/components/indicator/index.js 1:1998-2029
@ ./node_modules/react-native-indicators/index.js
@ ./src/screens/PreLoading.js
@ ./src/App.js
@ ./src/index.js
@ multi (webpack)-dev-server/client?http://localhost:8081 webpack/hot/dev-server ./src/index.js