{"id":28250232,"url":"https://github.com/h5sh/cs50m--lecture-5","last_synced_at":"2025-07-08T16:36:12.156Z","repository":{"id":182364823,"uuid":"658270439","full_name":"H5SH/CS50M--lecture-5","owner":"H5SH","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-25T09:21:06.000Z","size":194,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-19T13:16:36.516Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/H5SH.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-06-25T09:15:39.000Z","updated_at":"2024-12-17T06:00:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"135fa9aa-ca73-442c-b374-acf8272d0ae0","html_url":"https://github.com/H5SH/CS50M--lecture-5","commit_stats":null,"previous_names":["h5sh/cs50m--lecture-5"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/H5SH/CS50M--lecture-5","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/H5SH%2FCS50M--lecture-5","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/H5SH%2FCS50M--lecture-5/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/H5SH%2FCS50M--lecture-5/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/H5SH%2FCS50M--lecture-5/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/H5SH","download_url":"https://codeload.github.com/H5SH/CS50M--lecture-5/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/H5SH%2FCS50M--lecture-5/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259745133,"owners_count":22905052,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-19T13:16:34.878Z","updated_at":"2025-06-14T01:31:36.366Z","avatar_url":"https://github.com/H5SH.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LECTURE 5 - Lists \u0026 User input\n\n## Lists\n● In web, browsers will automatically become scrollable for content with heights taller than the window \u003cbr\u003e\n●  In mobile, we need to do that manually. We can do that using the following Components from React Native  \u003cbr\u003e\n\u0026nbsp; \u0026nbsp; \u0026nbsp; ○ ScrollView \u003cbr\u003e\n\u0026nbsp; \u0026nbsp; \u0026nbsp; ○ ListView (deprecated) \u003cbr\u003e\n\u0026nbsp; \u0026nbsp; \u0026nbsp; ○ FlatList, SectionList\u003cbr\u003e\n\n### ScrollView\n● The most basic scrolling view \u003cbr\u003e\n● I renders all of its children before appearing \u003cbr\u003e\n● To render an array of data, we can use .map() \u003cbr\u003e\n\u0026nbsp; \u0026nbsp; \u0026nbsp;○ Components in an array need a unique key prop \u003cbr\u003e\n**REF**  👉🏿 https://facebook.github.io/react-native/docs/scrollview.html \u003cbr\u003e\n\n### FlatList\n● A performant scrolling view for rendering data \u003cbr\u003e\n● “Virtualized:” only renders what’s needed at a time\u003cbr\u003e\n\u0026nbsp; \u0026nbsp; \u0026nbsp;○ Only the visible rows are rendered in first cycle\u003cbr\u003e\n\u0026nbsp; \u0026nbsp; \u0026nbsp;○ Rows are recycled, and rows that leave visibility may be unmounted\u003cbr\u003e\n● Pass an array of data and a renderItem function as props\u003cbr\u003e\n● Only updates if props are changed\u003cbr\u003e\n\u0026nbsp; \u0026nbsp; \u0026nbsp;○ Immutability is important\u003cbr\u003e\n**REF**  👉🏿 https://facebook.github.io/react-native/docs/flatlist.html\u003cbr\u003e\n\n### SectionList\n● Like FlatList with additional support for sections\u003cbr\u003e\n● Instead of data prop, define sections\u003cbr\u003e\n\u0026nbsp; \u0026nbsp; \u0026nbsp;○ Each section has its own data array\u003cbr\u003e\n\u0026nbsp; \u0026nbsp; \u0026nbsp;○ Each section can override the renderItem function with their own custom renderer\u003cbr\u003e\n● Pass a renderSectionHeader function for section headers \u003cbr\u003e\n**REF**  👉🏿 https://facebook.github.io/react-native/docs/sectionlist.html \u003cbr\u003e\n\n\n# CONTINUES TO LECTURE 5 - User input \u0026 Debugging\n\n### User Input\n● Controlled vs uncontrolled components \u003cbr\u003e\n\u0026nbsp; \u0026nbsp; \u0026nbsp;○ Where is the source of truth for the value of an input? \u003cbr\u003e\n● React recommends always using controlled components \u003cbr\u003e\n● Pass value and onChangeText props \u003cbr\u003e\n**REF**  👉🏿 https://facebook.github.io/react-native/docs/textinput.html \u003cbr\u003e\n\n\n\u003c!-- Demo --\u003e\n## Live Demo \nThis simple phone book App has been hosted in my Expo snacks\n\n⚙️   Project page: https://snack.expo.dev/@qbentil/lecture-5---contacts","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh5sh%2Fcs50m--lecture-5","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fh5sh%2Fcs50m--lecture-5","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh5sh%2Fcs50m--lecture-5/lists"}