{"id":13671778,"url":"https://github.com/AimWhy/simple-react","last_synced_at":"2025-04-27T18:31:42.638Z","repository":{"id":98746765,"uuid":"54446996","full_name":"AimWhy/simple-react","owner":"AimWhy","description":"Fast 3kb React alternative. Components \u0026 Virtual DOM","archived":false,"fork":false,"pushed_at":"2016-06-20T23:19:10.000Z","size":57,"stargazers_count":9,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-11T09:44:08.679Z","etag":null,"topics":[],"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/AimWhy.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}},"created_at":"2016-03-22T05:11:47.000Z","updated_at":"2024-02-26T12:19:16.000Z","dependencies_parsed_at":"2023-05-25T02:45:25.990Z","dependency_job_id":null,"html_url":"https://github.com/AimWhy/simple-react","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/AimWhy%2Fsimple-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AimWhy%2Fsimple-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AimWhy%2Fsimple-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AimWhy%2Fsimple-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AimWhy","download_url":"https://codeload.github.com/AimWhy/simple-react/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251187287,"owners_count":21549614,"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":"2024-08-02T09:01:18.464Z","updated_at":"2025-04-27T18:31:41.600Z","avatar_url":"https://github.com/AimWhy.png","language":"JavaScript","readme":"**fast, `3kb` alternative to React, with the same ES2015 API.**\n\n\n| Lifecycle method            | When it gets called                              |\n|-----------------------------|--------------------------------------------------|\n| `componentWillMount`        | before the component gets mounted to the DOM     |\n| `componentDidMount`         | after the component gets mounted to the DOM      |\n| `componentWillUnmount`      | prior to removal from the DOM                    |\n| `componentDidUnmount`       | after removal from the DOM                       |\n| `componentWillReceiveProps` | before new props get accepted                    |\n| `shouldComponentUpdate`     | before `render()`. Return `false` to skip render |\n| `componentWillUpdate`       | before `render()`                                |\n| `componentDidUpdate`        | after `render()`                                 |\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml xmlns=\"http://www.w3.org/1999/xhtml\"\u003e\n\n\u003chead\u003e\n    \u003cmeta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /\u003e\n    \u003ctitle\u003e\u003c/title\u003e\n\u003c/head\u003e\n\n\u003cbody\u003e\n    \u003cdiv id=\"why\"\u003e\u003c/div\u003e\n    \u003cscript src=\"../preact.js\"\u003e\u003c/script\u003e\n    \u003cscript\u003e\n        var h = preact.h;\n        var createClass = preact.createClass;\n        var render = preact.render;\n\n        var Clock = createClass({\n            getInitialState: function () {\n                return { time: Date.now() }\n            },\n\n            componentDidMount: function () {\n                var that=this;\n                this.timer = setInterval(function () {\n                    that.setState({ time: Date.now() });\n                }, 1000);\n            },\n\n            componentWillUnmount: function () {\n                clearInterval(this.timer);\n            },\n\n            render: function (props, state) {\n                var time = new Date(state.time).toLocaleTimeString();\n                return h('span', null, time);\n            }\n        });\n\n        render(document.getElementById('why'), h(Clock));\n    \u003c/script\u003e\n\u003c/body\u003e\n\n\u003c/html\u003e\n``` \n\nmodify from (preact)[https://github.com/developit/preact]\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAimWhy%2Fsimple-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAimWhy%2Fsimple-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAimWhy%2Fsimple-react/lists"}