react-native-web

How to generate class names instead of inline styles for react-native-web?

你。 提交于 2021-02-11 12:36:50
问题 I'm running expo web build which uses react-native-web. I noticed it generates inline styles so if I render a list of items, the styles get repeated for each item. Is there a way to make it generate a unique className instead and add to the head like styled-components? 回答1: Revisited this and realized it's because the components I was using did not use the StyleSheet.create api call internally, which WILL generate atomic css classes on react-native-web. Setting a regular object as the style

How to avoid loading Expo notifications bundle for web build?

ぃ、小莉子 提交于 2021-01-29 08:10:35
问题 I am using expo and react native web. I have integrated FCM for notifications for web but expo also loads a notifications bundle which I do not want. The issue is when the notification is received in the browser and message is clicked, the app gets the focus but crashes saying “TypeError: _emitter is undefined”. This is on this line in src/Notifications/Notifications.ts:40 _emitter.emit('notification', notification); So, it seems expo tries to use its Notifications module. Can I remove that

React native web issue with react native vector icons in storybook

限于喜欢 提交于 2021-01-29 07:28:45
问题 I created a project using react native web and I got react native icons working for web and mobile except on storybook. I'm not sure how to tell storybooks webpack config to load FontAwesome fonts. I tried adding FontAwesome in the preview-head.html but Still not showing the icons just a rectangle as a placeholder. What I would like is to have my icons showing up in the storybook webpack server. .storybook/main.js: const webpack = require('webpack'); const path = require('path'); const

babel arrow functions error in node_modules

我的未来我决定 提交于 2020-06-29 06:07:13
问题 when i want build react the bellow error appear(error in node_modules): ERROR in ./node_modules/react-native-video/Video.js 54:7 Module parse failed: Unexpected token (54:7) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders | } | > seek = (time, tolerance = 100) => { | if (isNaN(time)) throw new Error('Specified time is not a number'); And i add this section to babel file babel

Why is TypeScript not parsing my `react-native-web` code? (NOT using `create-react-native-app`)

给你一囗甜甜゛ 提交于 2019-12-25 02:20:22
问题 Already tried https://github.com/necolas/react-native-web/issues/832 Got: for: I thought the issue might be the linter error I was getting b/c of the react-native aliasing of react-native-web (which for some reason, TypeScript can't figure out...). Was able to resolve that via npm i -D react-native @types/react-native . However, still got the same error. Next, I tried converting my SFC (stateless functional component) to a class component. Still got: So I'm wondering why I'm getting this

how to solve this error You may need an appropriate loader to handle this file type

我只是一个虾纸丫 提交于 2019-12-21 07:13:09
问题 I got this error with this library https://github.com/react-native-web-community/react-native-web-linear-gradient/ the error link https://github.com/react-native-web-community/react-native-web-linear-gradient/issues/1 details of error: Module parse failed: Unexpected token (5:22) You may need an appropriate loader to handle this file type. my webpack: 'use strict'; const autoprefixer = require('autoprefixer'); const path = require('path'); const webpack = require('webpack'); const

how to solve this error You may need an appropriate loader to handle this file type

元气小坏坏 提交于 2019-12-21 07:13:08
问题 I got this error with this library https://github.com/react-native-web-community/react-native-web-linear-gradient/ the error link https://github.com/react-native-web-community/react-native-web-linear-gradient/issues/1 details of error: Module parse failed: Unexpected token (5:22) You may need an appropriate loader to handle this file type. my webpack: 'use strict'; const autoprefixer = require('autoprefixer'); const path = require('path'); const webpack = require('webpack'); const

Expo for Web failed to compile because of native base module

China☆狼群 提交于 2019-12-11 03:04:26
问题 I'm trying to get the "expo for web" part working for my managed expo project. I upgraded my managed expo project to expo sdk 33 so that I could also deploy my app on the web platform and ideally have it hosted from firebase. I followed official instructions from expo: Upgrading Expo SDK Walkthrough Expo CLI and SDK web support beta Using Expo for web in a expo init project on how to upgrade to SDK 33 and how to configure and enable the web platform. Expo-cli version is : '2.19.5' I'm using

how to use react-native-web and react-navigation together and access from web url

99封情书 提交于 2019-12-09 07:59:08
问题 UPDATE : react-navigation web support is done. follow this: https://reactnavigation.org/docs/en/web-support.html ORIGIN : I try to share my code between react-native and web. when I try react-native-web, it works well. but there is only one question, how to access the specific screen from URL? I read the react-navigation docs, there nothing about that. and react-router-native can catch the web URL, but it has navigator likes StackNavigator/DrawerNavigator. and idea about that? 回答1: I don't