Questions tagged [react-native-web]

react-native-web is a library aims to make react-native projects able to run in web browser, by providing the same Components and APIs of react-native for web.

534 questions
6
votes
2 answers

How to code split with Expo web (React Native Web)?

Is there a recommended approach for code splitting in Expo web projects? I cant find anything in the docs, even on the web performance page: https://docs.expo.io/guides/web-performance/ Im surprised as this something a lot (possibly most) web apps…
Evanss
  • 23,390
  • 94
  • 282
  • 505
6
votes
1 answer

AsyncStorage module not found in /expo/build/Notifications

I'm getting the below mentioned error when i try run application in the web mode. /node_modules/expo/build/Notifications/Notifications.js Module not found: Can't resolve 'react-native-web/dist/exports/AsyncStorage' in…
coders
  • 719
  • 1
  • 11
  • 35
6
votes
0 answers

Unused modules not treeshaken for react-native-web. Bundle size remains huge

We have a react native application with react-native-web used for the web bundle. The problem is the react-native-web bundle is 827kb in the final bundle and is the major part of the build. We are not using all the modules in the package yet the…
5
votes
1 answer

Sharing components made with Native-Base between ReactJs and React Native Projects

I am trying to share components between a ReactJs and React Native project. I have been successful in being able to share components that use React Native, but project that use Native Base get errors. My setup is this: I have a mono repo that holds…
5
votes
1 answer

Expo react native web gives error import scoped imports

I have a project which is react-native-web, and the expo is configured on it. The stating script has scoped imports @. I see that metro.config.js has aliases for those imports for which expo web is complaining, here is metro.config.js : /** * Metro…
Maverick
  • 2,738
  • 24
  • 91
  • 157
5
votes
3 answers

React Native Web Image component not showing image

I have an Image component which I am using to load an image into a header for my application. I can create a border for where the image is supposed to be but am unable to get the image to properly load. Here is the code where I am loading the image…
Hyun Kim
  • 89
  • 1
  • 6
5
votes
1 answer

Prepend data to a FlatList on react native web, while maintaining visible content

Is it possible to implement a Flatlist with react native web where you prepend data while maintaining the visible content? Right now, it jumps to the top of the Flatlist when you prepend something. I am using onContentSizeChange to force move the…
Ryan Pergent
  • 4,432
  • 3
  • 36
  • 78
5
votes
4 answers

Hide route params from the url with react-navigation

I am adapting a ReactNative mobile app to ReactNative Web. The app is done with react-navigation. Currently, every time I set the params of a route (either through navigate or setParams), those params show in the URL. I end up with bad looking URLs…
Ryan Pergent
  • 4,432
  • 3
  • 36
  • 78
5
votes
2 answers

Expo build:web builds huge bundle and slow website with bad performance

The bundle size produced by expo build:web is huge at average 3mb. I completed steps at https://docs.expo.io/guides/web-performance/. My app has no images so no real issue to optimise them. Other suggested improvements changed very little. I used…
Yesman500
  • 156
  • 1
  • 2
  • 8
5
votes
2 answers

react native web, __DEV__ not defined

If you want to share code between RN and RN-web, __DEV__ should also be provided in the both platform. However I can't add DEV using const __DEV__ = process.env.NODE_ENV !== 'production'; new webpack.DefinePlugin({__DEV__}) I can set window.__DEV__…
eugene
  • 39,839
  • 68
  • 255
  • 489
5
votes
1 answer

How can I build my React Native Storybook to web?

I am running React Native Storybook which runs Storybook in the Native emulator. In addition to the how React Native Storybook works currently, I would also like to build an instance of it for web as a reference companion to our app. I am using…
Elise Chant
  • 5,048
  • 3
  • 29
  • 36
5
votes
6 answers

How can I know my current route in react-navigation 5?

I am using this https://reactnavigation.org/docs/en/navigating-without-navigation-prop.html to access my navigation from any source, my file look as follow: import { createRef } from 'react'; export const navigationRef = createRef(); export…
Dimitri Kopriwa
  • 13,139
  • 27
  • 98
  • 204
5
votes
2 answers

RecyclerListView scrolls to top onEndReached with functional component

I have implemented a RecyclerListView(Flipkart Github) using Redux as seen below. Everything seems to be working great except when onEndReached is called and a new batch of data comes through, the list gets positioned to the top of the page rather…
Mike
  • 12,359
  • 17
  • 65
  • 86
5
votes
1 answer

Video suport for React-Native-Web

Is there any solutions for playing video in React-Native-Web React-Native-Web: https://github.com/necolas/react-native-web React-Native-Video: https://github.com/react-native-community/react-native-video
5
votes
0 answers

Access underlying DOM node in react-native-web

When creating a custom component in react-native-web, I'd want to access the underlying DOM node of my View component to add/remove an eventListener. class MyButton extends React.Component { render() { return (
tvanlaerhoven
  • 709
  • 5
  • 15
1 2
3
35 36