stacks icon indicating copy to clipboard operation
stacks copied to clipboard

Rendering issue when switching screen using react-navigation in combination w/ react-native-web

Open nikgraf opened this issue 2 years ago • 7 comments

When switching to the page it looks like this: Screenshot 2022-05-13 at 13 15 47

When refreshing the page it looks like this (and this is how it supposed to be): Screenshot 2022-05-13 at 13 15 55

Code:

      <Text style={tw`mt-4 mb-1`}>Nodes</Text>
      <Tiles style={tw`max-w-lg`} space={4} columns={10}>
        <Icon name="at-line" />
        <Icon name="code-s-slash-line" />
        <Icon name="double-quotes-l" />
        <Icon name="heading" />
        <Icon name="h-1" />
        <Icon name="h-2" />
        <Icon name="h-3" />
        <Icon name="h-4" />
        <Icon name="h-5" />
        <Icon name="h-6" />
        <Icon name="indent-decrease" />
        <Icon name="indent-increase" />
        <Icon name="list-check" />
        <Icon name="list-check-2" />
        <Icon name="list-ordered" />
        <Icon name="list-unordered" />
        <Icon name="paragraph" />
        <Icon name="table-2" />
        <Icon name="text" />
      </Tiles>

This seems like a general issue with the library. I also noticed it on other pages. Any ideas?

nikgraf avatar May 13 '22 11:05 nikgraf

@mobily seems like it's an issue with react-native-web itself or react-navigation because I noticed it also happens on screens where stacks is not used

nikgraf avatar May 17 '22 13:05 nikgraf

Actually realized we used stacks more than I thought and all cases were stacks related.

For a horizontal stack I nailed down the issue to a broken flex-ba Screenshot 2022-05-17 at 22 33 48 sis setting.

This might be related: https://github.com/necolas/react-native-web/issues/1264

nikgraf avatar May 17 '22 20:05 nikgraf

hello @nikgraf! 👋 thanks for posting this issue, could you try with v2.1.0, please? also, if this still occurs, a repro repo would be helpful! 🙏

mobily avatar Jun 05 '22 16:06 mobily

@mobily still happening :(

Screenshot 2022-06-09 at 13 52 31

nikgraf avatar Jun 09 '22 11:06 nikgraf

sorry, don't have time to setup a full repro. we are using react-navigation and after switching between screens it sometimes happens. Could be something wrong with our setup

nikgraf avatar Jun 09 '22 11:06 nikgraf

@nikgraf I replaced all instances of <Stack/> and <Inline/> with <Box/>, and removed flex='content'. This seems to have solved the problem. Not ideal, but it works.

edit: it seems fixed now in the latest version

vbylen avatar Jun 14 '22 00:06 vbylen

I was update react-native-web to latest version (0.18.1) and all works correctly now. But I don't know, can I upgrade RNW without Expo migration guide?

makhataibar avatar Jun 27 '22 05:06 makhataibar