{"id":24653096,"url":"https://github.com/gjc9620/react-string-template","last_synced_at":"2025-10-07T12:31:22.065Z","repository":{"id":57345814,"uuid":"161201188","full_name":"gjc9620/react-string-template","owner":"gjc9620","description":"🚀 simple string template with react! 🚀","archived":false,"fork":false,"pushed_at":"2019-01-23T16:04:15.000Z","size":139,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-13T22:48:02.555Z","etag":null,"topics":["es6","javascript","react","string-template"],"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/gjc9620.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":"2018-12-10T16:09:31.000Z","updated_at":"2023-05-26T17:04:08.000Z","dependencies_parsed_at":"2022-09-17T06:31:35.001Z","dependency_job_id":null,"html_url":"https://github.com/gjc9620/react-string-template","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gjc9620%2Freact-string-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gjc9620%2Freact-string-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gjc9620%2Freact-string-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gjc9620%2Freact-string-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gjc9620","download_url":"https://codeload.github.com/gjc9620/react-string-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235628189,"owners_count":19020541,"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":["es6","javascript","react","string-template"],"created_at":"2025-01-25T20:13:48.353Z","updated_at":"2025-10-07T12:31:16.783Z","avatar_url":"https://github.com/gjc9620.png","language":"JavaScript","readme":"# react-string-template\nreact-string-template is simple string template with react\n\n## install\n`npm i --save react-string-template`\n\n\n``` jsx\n  \u003cReactStringTemplate\n    str={\"{name} is a series of {foo} novels written by British author {author} in {yeah}.\"}\n    renderNoMatch={()=\u003e'not match'}\n    values={{\n      name: \u003ca href=\"https://www.google.com/search?q=Harry Potter\" key='potter'\u003eHarry Potter\u003c/a\u003e,  // Don't forget write key\n      foo: 'fantasy',\n      bar: 'novels',\n      author: 'J. K. Rowling',\n      yeah: 1997,\n    }} \u003e\n    {(children)=\u003e\u003cdiv\u003e{children}\u003c/div\u003e}\n  \u003c/ReactStringTemplate\u003e\n\n  //Harry Potter is a series of fantasy novels written by British {author} J. K. Rowling in 1997.\n\n```\n\n\n``` jsx\n  // add click event\n  \u003cReactStringTemplate\n    str={\"{charmName} Charm\"}\n    values={{\n      charmName: (\n        \u003cspan\n          key='patronus'\n          onClick={()=\u003ealert('Patronus!')}\u003e\n          Patronus\n        \u003c/span\u003e\n      ),\n    }} \u003e\n    {(children)=\u003e\u003cdiv\u003e{children}\u003c/div\u003e}\n  \u003c/ReactStringTemplate\u003e\n\n```\n\n\n``` jsx\n  // render no Match\n  \u003cReactStringTemplate\n    str={\"I am {name}\"}\n    renderNoMatch={()=\u003e'not match'} \u003e\n    {(children)=\u003e\u003cdiv\u003e{children}\u003c/div\u003e}\n  \u003c/ReactStringTemplate\u003e\n\n  //I am not match\n\n```\n\nIf you don't need escape use `{{escape}}`\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgjc9620%2Freact-string-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgjc9620%2Freact-string-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgjc9620%2Freact-string-template/lists"}