Closed hazmah0 closed 2 months ago
What is the tvos fork? How would i test this?
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.
@hazmah0 can you provide me a repo with your specific setup which reproduces the problem?
Sure, here you go.
storybook:ios
or storybook:android
@hazmah0 great thanks, will take a look soon
This seems like an issue with flatlist on the tvos fork, the items are there they just don't get the right height
@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
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.
I can also probably just change this flex:1 on sb side but ran out of time today, will take a look soon.
@dannyhw you can close this if needed, see link above to the PR in the TV repo that fixes the issue.
@douglowder awesome, thanks!
Describe the bug The sidebar doesn't display stories with
react-native-tvos
fork.To Reproduce Steps to reproduce the behavior:
npx degit chromaui/intro-storybook-react-native-template#main taskbox
yarn install
yarn storybook:ios
Expected behavior All stories should be loaded and displayed in the sidebar.
Screenshots With tvos fork:
With regular react-native
System:
Additional context react-native version: 0.73.6 react-native-tvos version: 0.73.6-1