{"id":20003230,"url":"https://github.com/mbrsagor/youreacker","last_synced_at":"2026-05-13T06:04:03.143Z","repository":{"id":111136680,"uuid":"324414880","full_name":"mbrsagor/youReacker","owner":"mbrsagor","description":"The project is React.JS basic to Advance topic. when sometimes forgot anything then I follow the repo. The repo is very helpful for every start-up react.JS developer.","archived":false,"fork":false,"pushed_at":"2021-06-25T18:04:54.000Z","size":1441,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-12T13:25:22.480Z","etag":null,"topics":["context-api-react","hooks-api-react","reactjs","redux"],"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/mbrsagor.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":"2020-12-25T18:39:43.000Z","updated_at":"2021-11-09T17:27:34.000Z","dependencies_parsed_at":"2023-06-02T21:45:21.609Z","dependency_job_id":null,"html_url":"https://github.com/mbrsagor/youReacker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrsagor%2FyouReacker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrsagor%2FyouReacker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrsagor%2FyouReacker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrsagor%2FyouReacker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbrsagor","download_url":"https://codeload.github.com/mbrsagor/youReacker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241441858,"owners_count":19963493,"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":["context-api-react","hooks-api-react","reactjs","redux"],"created_at":"2024-11-13T05:24:43.293Z","updated_at":"2026-05-13T06:03:58.101Z","avatar_url":"https://github.com/mbrsagor.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# YouReacker\n\u003e The repo is pure React.JS project where has basic to advance topic in react.js step by step.\n\n#### Install and run the repo in your local dev server.\n\n\nThe following steps will walk you thru installation on a Mac. I think linux should be similar. It's also possible to develop on a Windows machine, but I have not documented the steps. If you've developed the `React` apps on Windows, you should have little problem getting up and running.\n\n\n```base\ngit clone https://github.com/mbrsagor/youReacker.git\ncd youReacker\nyarn install\nyarn start\n```\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in the browser.\n\n\n###### Context API\n\n```javascript\nimport React, { Component, createContext } from 'react'\n\n\nconst Profile = () =\u003e {\n    return (\n        \u003cAuthContext.Consumer\u003e\n            {value =\u003e (\n                \u003cdiv\u003e\n                    \u003cp\u003eName: {value.user.name}\u003c/p\u003e\n                    \u003cp\u003eEmail: {value.user.email}\u003c/p\u003e\n                \u003c/div\u003e\n            )}\n        \u003c/AuthContext.Consumer\u003e\n    )\n}\n\n\nconst Navbar = () =\u003e {\n\n    return (\n        \u003cAuthContext.Consumer\u003e\n            {({isAuthenticated, toggleAuth}) =\u003e (\n                \u003c\u003e\n                    {isAuthenticated ? \u003cbutton onClick={toggleAuth} className=\"btn btn-danger btn-sm\"\u003eLogout\u003c/button\u003e : \u003cbutton onClick={toggleAuth} className=\"btn btn-success btn-sm\"\u003eLogin\u003c/button\u003e}\n                \u003c/\u003e\n            )}\n        \u003c/AuthContext.Consumer\u003e\n    )\n}\n\n\nconst User = () =\u003e {\n    return (\n        \u003cAuthContext.Consumer\u003e\n            {value =\u003e (\n                \u003cdiv\u003e\n                    \u003cNavbar /\u003e\n                    \u003chr /\u003e\n                    {value.isAuthenticated ? \u003cProfile /\u003e : \u003cp\u003ePlease login.\u003c/p\u003e}\n                \u003c/div\u003e\n            )}\n        \u003c/AuthContext.Consumer\u003e\n    )\n}\n\n\nconst AuthContext = createContext();\n\n/**\n * Main conponent\n */\n\nclass ContextAPI extends Component {\n\n    state = {\n        user: {\n            name: 'Mbr sagor',\n            email: 'mbrsagor@gmail.com',\n            profession: 'software engineer'\n        },\n        isAuthenticated: true\n    }\n\n    toggleAuthenticated = () =\u003e {\n        this.setState(prev =\u003e ({isAuthenticated: !prev.isAuthenticated}));\n    }\n\n    render() {\n        return (\n            \u003cdiv\u003e\n                \u003cAuthContext.Provider value={{\n                    ...this.state, \n                    toggleAuth: this.toggleAuthenticated\n                }}\u003e\n                    \u003ch2\u003eContext API\u003c/h2\u003e\n                    \u003cUser /\u003e\n                \u003c/AuthContext.Provider\u003e\n            \u003c/div\u003e\n        )\n    }\n}\n\nexport default ContextAPI\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbrsagor%2Fyoureacker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbrsagor%2Fyoureacker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbrsagor%2Fyoureacker/lists"}