{"id":18423030,"url":"https://github.com/sandeshnaroju/react-native-dbcontext","last_synced_at":"2026-04-28T18:31:13.259Z","repository":{"id":38895173,"uuid":"262720902","full_name":"sandeshnaroju/react-native-dbcontext","owner":"sandeshnaroju","description":"It is an example how child components in react native gets database reference from parent component using React Context API.","archived":false,"fork":false,"pushed_at":"2023-01-26T19:57:46.000Z","size":2023,"stargazers_count":0,"open_issues_count":17,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T16:46:04.680Z","etag":null,"topics":["react-context-api","react-native","react-native-library"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/sandeshnaroju.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}},"created_at":"2020-05-10T05:45:11.000Z","updated_at":"2020-05-27T04:22:20.000Z","dependencies_parsed_at":"2023-02-14T23:00:43.790Z","dependency_job_id":null,"html_url":"https://github.com/sandeshnaroju/react-native-dbcontext","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sandeshnaroju/react-native-dbcontext","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandeshnaroju%2Freact-native-dbcontext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandeshnaroju%2Freact-native-dbcontext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandeshnaroju%2Freact-native-dbcontext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandeshnaroju%2Freact-native-dbcontext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sandeshnaroju","download_url":"https://codeload.github.com/sandeshnaroju/react-native-dbcontext/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandeshnaroju%2Freact-native-dbcontext/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32394211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T14:34:11.604Z","status":"ssl_error","status_checked_at":"2026-04-28T14:32:37.009Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["react-context-api","react-native","react-native-library"],"created_at":"2024-11-06T04:34:41.822Z","updated_at":"2026-04-28T18:31:13.239Z","avatar_url":"https://github.com/sandeshnaroju.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-dbcontext\nIt is an example how all child components in react native gets database reference from parent component using React Context API.\n\n### NOTE: ###\nIn this example, I have used watermelonDB, but you can use whatever database framework you want to use. \n\nread the complete usage [here](https://www.naroju.com/how-to-use-react-context-to-pass-database-reference-to-child-components/) \n\n### HOW TO USE:\n\n1. Copy the db folder into your project, and Initialize your DB in the `DbProvider.js` file itself. And pass the value to `DbContext.Provider`.  \n2. In the parent component surround elements with `DbProvider`.\n3. In the Child component you can either surround elements with `DbContext.Consumer` or use `this.context` to get the reference of database. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandeshnaroju%2Freact-native-dbcontext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsandeshnaroju%2Freact-native-dbcontext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandeshnaroju%2Freact-native-dbcontext/lists"}