-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: example of non virtualized manual grid #51
Conversation
1f50df4
to
f1c7edb
Compare
|
||
const ShortProgramList = () => { | ||
const navigation = useNavigation<NativeStackNavigationProp<RootStackParamList>>(); | ||
const programs = getPrograms().slice(0, 6); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't you use a lodash.chunk()
to transform a 1D list into a 2D list with rows of size 6, and iterate on the rows?
Here you hardcoded 3 ShortProgramList
, it would be better to generalize a little bit ;) (we're lucky to have static data here but it's not a real world example)
); | ||
|
||
export const NonVirtualizedGridPage = () => { | ||
const programsList = chunk(getPrograms(), 7); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could extract this into a local constant in the file to make it more obvious 😁
const programsList = chunk(getPrograms(), 7); | |
const programsList = chunk(getPrograms(), ROW_SIZE); |
New page in the example app with a non-virtualized grid