{"id":21505620,"url":"https://github.com/ayeshakhan07/reactforwardref","last_synced_at":"2026-04-15T16:03:12.121Z","repository":{"id":126631254,"uuid":"495095099","full_name":"AyeshaKhan07/ReactForwardRef","owner":"AyeshaKhan07","description":"Forward Ref in React","archived":false,"fork":false,"pushed_at":"2022-05-22T16:07:42.000Z","size":161,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-04T04:00:00.798Z","etag":null,"topics":["forwardref","mui","react","reactjs"],"latest_commit_sha":null,"homepage":"","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/AyeshaKhan07.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-22T15:11:22.000Z","updated_at":"2022-05-22T19:14:21.000Z","dependencies_parsed_at":"2023-06-17T12:00:41.510Z","dependency_job_id":null,"html_url":"https://github.com/AyeshaKhan07/ReactForwardRef","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AyeshaKhan07/ReactForwardRef","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AyeshaKhan07%2FReactForwardRef","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AyeshaKhan07%2FReactForwardRef/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AyeshaKhan07%2FReactForwardRef/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AyeshaKhan07%2FReactForwardRef/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AyeshaKhan07","download_url":"https://codeload.github.com/AyeshaKhan07/ReactForwardRef/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AyeshaKhan07%2FReactForwardRef/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31848664,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"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":["forwardref","mui","react","reactjs"],"created_at":"2024-11-23T19:09:07.741Z","updated_at":"2026-04-15T16:03:11.856Z","avatar_url":"https://github.com/AyeshaKhan07.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![pngwing com](https://user-images.githubusercontent.com/41265756/147820719-14187d43-5d31-457c-8deb-7b14ff6b0a4e.png)\n# FORWARD REF IN REACT\n\u003chr\u003e\n\n![image](https://user-images.githubusercontent.com/41265756/169702968-857005ae-c846-40f3-b12f-59829f43d77f.png)\n\n## About\nThis project was created to study the concept of forward ref in React. React forwardRef is a method that allows parent components pass down (i.e., “forward”) refs to their children. Using forwardRef in React gives the child component a reference to a DOM element created by its parent component. This then allows the child to read and modify that element anywhere it is being used.\n\n## Technologies\n- [React](https://reactjs.org/)\n- [Material UI](https://mui.com/)\n\n## How To Use\n```\n# Clone this repository\n$ git clone https://github.com/AyeshaKhan07/ReactForwardRef.git\n\n# Go into the repository\n$ cd ReactForwardRef\n\n# Install dependencies\n$ npm install\n\n# Run the app\n$ npm start\n```\n\nForward ref is forwarding or passing the reference of the DOM element to the child component. By using forwardRef we can manipulate the element's properties without re-rendering that element. In this project, I created a counter app in which the value is incremented by two methods:\n1. React State\n2. Forward Ref \n\nWhile running the app, follow the below steps to get the better understanding: \n\n- Open the console and change the switch to increment by react state. \n- You will see every time you press the increment button, this message got printed \"component rendered!\".\n- Now change the switch again to increment by forward ref.\n- Now you will see every time you press the increment button, no message got printed on console.\n\nThis proves that if we increment the value by state the component will re-render on every increment, but if we increment by forwardRef the component will just update the value without rerendering. \n\n## Further Reading\n- https://blog.logrocket.com/cleaning-up-the-dom-with-forwardref-in-react/\n- https://reactjs.org/docs/forwarding-refs.html\n\n## Author\n@AyeshaKhan07\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayeshakhan07%2Freactforwardref","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fayeshakhan07%2Freactforwardref","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayeshakhan07%2Freactforwardref/lists"}