Giter Club home page Giter Club logo

Comments (11)

dannyhw avatar dannyhw commented on June 10, 2024 1

@hazmah0 great thanks, will take a look soon

from react-native.

dannyhw avatar dannyhw commented on June 10, 2024

What is the tvos fork? How would i test this?

from react-native.

hazmah0 avatar hazmah0 commented on June 10, 2024

The repository is here https://github.com/react-native-tvos/react-native-tvos. It's basically a fork of react-native that adds support for tv platforms like tvOS and Android TV. Since Im building an app that should target both mobile and tv platforms Im currently using this fork.

The easiest way to test this would be to follow the official tutorial from the Storybook docs to generate a project, but instead use the tvos fork by modifying the dependencies:
"react-native": "npm:react-native-tvos@^0.73.6-1"

My specific setup uses expo and these changes are documented here but should apply for non expo applications as well.

from react-native.

dannyhw avatar dannyhw commented on June 10, 2024

@hazmah0 can you provide me a repo with your specific setup which reproduces the problem?

from react-native.

hazmah0 avatar hazmah0 commented on June 10, 2024

Sure, here you go.

  1. Clone the repo
  2. Install dependencies
  3. Open either ios or android emulator with storybook:ios or storybook:android
  4. Once the app is loaded, open the sidebar. There should be stories here but the sidebar is empty

from react-native.

dannyhw avatar dannyhw commented on June 10, 2024

This seems like an issue with flatlist on the tvos fork, the items are there they just don't get the right height

from react-native.

dannyhw avatar dannyhw commented on June 10, 2024

@hazmah0 I found the issue, the flex:1 on the FlatList style seems to break it, if you patch this line in the @storybook/react-native package you can see it works

node_modules/@storybook/react-native/dist/index.js

var styles = import_react_native2.StyleSheet.create({
  sectionList: { flex: 1 }, <---
  sectionListContentContainer: {
    paddingBottom: 6,
  },
});

If you make it this instead it works

var styles = import_react_native2.StyleSheet.create({
  sectionList: { height: "100%"}, <----
  sectionListContentContainer: {
    paddingBottom: 6,
  },
});

Seems to me like a bug in the flatlist implementation on tv os react native

from react-native.

hazmah0 avatar hazmah0 commented on June 10, 2024

Thanks for looking into this! I asked one of the maintainer of the tvos fork about this but they haven't tried running storybook unfortunately. Iv'e made them aware of the problem and the issue I created here so maybe they can pitch in on this.

from react-native.

dannyhw avatar dannyhw commented on June 10, 2024

I can also probably just change this flex:1 on sb side but ran out of time today, will take a look soon.

from react-native.

douglowder avatar douglowder commented on June 10, 2024

@dannyhw you can close this if needed, see link above to the PR in the TV repo that fixes the issue.

from react-native.

dannyhw avatar dannyhw commented on June 10, 2024

@douglowder awesome, thanks!

from react-native.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.