{"id":16229554,"url":"https://github.com/baseballyama/svelte-in-react-ts","last_synced_at":"2025-09-10T19:34:05.995Z","repository":{"id":115901763,"uuid":"515110688","full_name":"baseballyama/svelte-in-react-ts","owner":"baseballyama","description":"Using Svelte component in React app","archived":false,"fork":false,"pushed_at":"2022-07-20T14:34:45.000Z","size":1182,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T03:48:00.796Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/baseballyama.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-07-18T09:09:25.000Z","updated_at":"2022-07-20T14:08:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"1000bcfe-9bfb-41eb-b9b4-23ab57386d09","html_url":"https://github.com/baseballyama/svelte-in-react-ts","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/baseballyama%2Fsvelte-in-react-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baseballyama%2Fsvelte-in-react-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baseballyama%2Fsvelte-in-react-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baseballyama%2Fsvelte-in-react-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baseballyama","download_url":"https://codeload.github.com/baseballyama/svelte-in-react-ts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247785920,"owners_count":20995642,"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-10-10T12:58:35.000Z","updated_at":"2025-04-08T05:42:24.595Z","avatar_url":"https://github.com/baseballyama.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Using Svelte from React with TypeScript\n\nThis repository was created based on [Tan Li Hau's video](https://www.youtube.com/watch?v=6MI9mirMh6w).\nAnd I added TypeScript support.\n\nDEMO: https://baseballyama.github.io/svelte-in-react-ts/\n\nThis repository supported below features.\n\n- Reactive props between React and Svelte / Two-way data binding\n- Reactive context between React and Svelte\n- Calling Svelte functions from React\n\n## Setup\n\n### Install React (commit: [286de46](https://github.com/baseballyama/svelte-in-react/commit/286de46), [a722fec](https://github.com/baseballyama/svelte-in-react/commit/a722fec))\n\n```sh\nnpx create-react-app svelte-in-react --template typescript\ncd svelte-in-react\nnpm i\n# to configure about Svelte, I need to modify webpack config.\nnpm run eject\n```\n\n### Install Svelte (commit: [4009d74](https://github.com/baseballyama/svelte-in-react/commit/4009d74))\n\n```sh\nnpm install --save svelte svelte-loader svelte-preprocess\n# for TypeScript.\ncurl https://raw.githubusercontent.com/sveltejs/language-tools/master/packages/svelte2tsx/svelte-shims.d.ts \u003e ./src/svelte-shims.d.ts\n```\n\nAnd add svelte-loader config at `config/webpack.config.js`.\n\n```js\n// add this\nconst sveltePreprocess = require(\"svelte-preprocess\");\n\nmodule.exports = function (webpackEnv) {\n  module: {\n    rules: [\n      {\n        oneOf: [\n          // add this.\n          {\n            test: [/\\.svelte$/],\n            loader: require.resolve(\"svelte-loader\"),\n            options: {\n              preprocess: sveltePreprocess()\n            }\n          },\n        ]\n      }\n    ]\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaseballyama%2Fsvelte-in-react-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaseballyama%2Fsvelte-in-react-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaseballyama%2Fsvelte-in-react-ts/lists"}