sarthakpranesh / react-native-everywhere

React Native Template based on Expo and Tauri to build app for platforms like Android, iOS, Web, MacOS, Windows, and Linux
MIT License
67 stars 13 forks source link

Tauri build windows #2

Open sweatben opened 2 years ago

sweatben commented 2 years ago

Hello, thank you for your work. I tested your 2.0 and during the build the problem is identical to 1.0.

Indeed the layout in dev mode works but during the build-desktop the layout at the App.tsx level <View onLayout={onLayout} style={{ flex: 1 }}>

is not applied?

Do you have a solution?

good to you.

sarthakpranesh commented 2 years ago

Hey, I haven't been using windows for sometime now. But I do remember their being some differences in the CSS support when we package application for windows. You can replace the style with something like:

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  width: 100vw;
  overflow: hidden;

Will drop another comment with some references around this later.

sweatben commented 2 years ago

Hello, thank you, indeed it is necessary to specify width, height and the display flex. That everything is working properly.

style={{ display:'flex', flexDirection:'column', alignItems: 'center', justifyContent: 'center', width:'100vw', height:'100vh' }}

KKuehlem commented 1 week ago

Just encountered the same issue on windows. <View onLayout={onLayout} style={{ display:'flex', flexDirection:'column', alignItems: 'center', justifyContent: 'center', width:'100vw', height:'100vh' }}> did not help for me, but adding cardStyle: {display:'flex', flexDirection:'column', alignItems: 'center', justifyContent: 'center', width:'100vw', height:'100vh'} after src/navigation/index.tsx:30 does the trick.

However, when I press increment on the counter page, the screen turn white... Does anyone know why?

sarthakpranesh commented 1 week ago

when I press increment on the counter page, the screen turn white

Screen turning white might indicate a crash in the React application but can't be sure. Can you share a reproducible project repository.

KKuehlem commented 1 week ago

It happens with this repository without modifications when I build for windows. But I figured out another solution for my original problem in the meantime.