{"id":16061129,"url":"https://github.com/robinfr/html-to-react-events","last_synced_at":"2026-05-06T22:02:33.883Z","repository":{"id":57267674,"uuid":"117957959","full_name":"Robinfr/html-to-react-events","owner":"Robinfr","description":"Convert HTML event names to React event handler names.","archived":false,"fork":false,"pushed_at":"2018-10-22T13:19:59.000Z","size":87,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-11T10:41:26.254Z","etag":null,"topics":["events","html","javascript","react"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Robinfr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-18T08:58:28.000Z","updated_at":"2018-10-22T13:19:57.000Z","dependencies_parsed_at":"2022-08-25T02:51:43.310Z","dependency_job_id":null,"html_url":"https://github.com/Robinfr/html-to-react-events","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robinfr%2Fhtml-to-react-events","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robinfr%2Fhtml-to-react-events/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robinfr%2Fhtml-to-react-events/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robinfr%2Fhtml-to-react-events/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Robinfr","download_url":"https://codeload.github.com/Robinfr/html-to-react-events/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247312093,"owners_count":20918344,"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":["events","html","javascript","react"],"created_at":"2024-10-09T04:07:56.760Z","updated_at":"2026-05-06T22:02:28.864Z","avatar_url":"https://github.com/Robinfr.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HTML to React events\nConverts HTML event names to React event handler names.\n\nEver tried working with HTML event names but needed to have the name of the related React event handler? Now you can use this library to easily retrieve the event handler name or bind to it straight away.\n\n## Install\nInstall with NPM/Yarn:\n\n```bash\nnpm install html-to-react-events --save\n```\n\n## Usage\nGetting the event handler name in React:\n\n```javascript\nimport { convertEvent} from 'html-to-react-events';\n\nconst eventName = 'dblclick';\nconst reactEventHandler = convertEvent(eventName);\n\nconsole.log(reactEventHandler); //Will return onDoubleClick\n```\n\nBinding a single event:\n\n```javascript\nimport { bindEvent } from 'html-to-react-events';\n\nconst eventName = 'dblclick';\n\nconst MyComponent = ({onConfirm}) =\u003e (\n    \u003cdiv {...bindEvent(eventName, onConfirm)}\u003e\n        Double click to confirm\n    \u003c/div\u003e\n);\n```\n\nBinding multiple events:\n\n```javascript\nimport { bindEvents } from 'html-to-react-events';\n\nconst eventName = 'dblclick';\n\nconst MyComponent = ({onEdit, onConfirm}) =\u003e {\n    const events = {\n        'click': onEdit,\n        'dblclick': onConfirm\n    };\n\n    return (\n        \u003cdiv {...bindEvents(events)}\u003e\n            One click to edit. \u003cbr /\u003e\n            Double click to confirm.\n        \u003c/div\u003e\n    );\n}\n```\n\n## Supported events\nFor the supported events, see https://reactjs.org/docs/events.html.\n\n## TypeScript\nTypings are included in the library.\n\n## License\nMIT © [R. Franken](https://github.com/Robinfr)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobinfr%2Fhtml-to-react-events","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobinfr%2Fhtml-to-react-events","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobinfr%2Fhtml-to-react-events/lists"}