{"id":15893094,"url":"https://github.com/sequencemedia/react-router-redux-render","last_synced_at":"2025-03-20T12:34:04.110Z","repository":{"id":37549855,"uuid":"189053270","full_name":"sequencemedia/react-router-redux-render","owner":"sequencemedia","description":"Render isomorphic React + React Router + Redux apps and components in Node","archived":false,"fork":false,"pushed_at":"2024-04-13T03:59:06.000Z","size":3492,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-14T01:02:47.535Z","etag":null,"topics":["isomorphic","react","react-router","redux","render"],"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/sequencemedia.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}},"created_at":"2019-05-28T15:17:06.000Z","updated_at":"2024-04-15T05:42:11.355Z","dependencies_parsed_at":"2024-01-08T05:52:44.238Z","dependency_job_id":"eefe1135-4b4e-437d-8d0e-0e4706f55aa9","html_url":"https://github.com/sequencemedia/react-router-redux-render","commit_stats":{"total_commits":919,"total_committers":4,"mean_commits":229.75,"dds":0.007616974972796564,"last_synced_commit":"30a9ed128a0b93e11ec4e3e76458124d054fd4a3"},"previous_names":[],"tags_count":149,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sequencemedia%2Freact-router-redux-render","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sequencemedia%2Freact-router-redux-render/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sequencemedia%2Freact-router-redux-render/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sequencemedia%2Freact-router-redux-render/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sequencemedia","download_url":"https://codeload.github.com/sequencemedia/react-router-redux-render/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221766710,"owners_count":16877337,"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":["isomorphic","react","react-router","redux","render"],"created_at":"2024-10-06T08:07:26.581Z","updated_at":"2025-03-20T12:34:04.103Z","avatar_url":"https://github.com/sequencemedia.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-router-redux-render\n\nRender isomorphic _React_ apps and components in Node.\n\n- Using _React Router_\n- With Redux\n\n_For React Router 7._\n\nAn example implementation can be found in [react-router-pagination-io](http://github.com/sequencemedia/react-router-pagination-io.git).\n\n## Example\n\nIn Express:\n\n```javascript\nconst express = require('express')\n\nconst app = express()\nconst port = 3000\n\nconst {\n  configureStore\n} = require('./path/to/store')\n\nconst store = configureStore()\n\nconst routes = require('./path/to/routes')\n\nconst {\n  renderToString\n} = require('react-router-redux-render')\n\napp.get('/', ({ url: { path: pathname = '/' } }, res) =\u003e res.send(renderToString(store, routes, pathname)))\n\napp.listen(port, () =\u003e console.log(`Express ${port}`))\n```\n\nIf React Router matches the `pathname` to a `\u003cRoute /\u003e` then `renderToString` returns a string.\n\nIf `renderToString` encounters an error then it throwa a `500 Internal Server Error`.\n\nIf `renderToString` cannot match the `pathname` to a `\u003cRoute /\u003e` then it throws a `404 Not Found`.\n\n## In this package\n\n`react-router-redux-render` exports three functions:\n\n1. `renderToString`\n2. `renderToStaticMarkup`\n3. `render`\n\n`renderToString` generates `\u003chtml /\u003e` including the attributes that _React_ uses in `ReactDOM.hydrate()`. It implements [`ReactDOMServer.renderToString()`](https://reactjs.org/docs/react-dom-server.html#rendertostring).\n\n`renderToStaticMarkup` doesn't include those attributes. It's useful for using React as a rendering engine for static pages. It implements [`ReactDOMServer.renderToStaticMarkup()`](https://reactjs.org/docs/react-dom-server.html#rendertostraticmarkup).\n\n`render` executes `renderToString` but returns a `Promise` which resolves to a string.\n\n## Companion packages\n\n1. `@sequencemedia/react-router-redux-render` for React Router apps (with Redux)\n2. `@sequencemedia/react-router-render` for React Router apps (without Redux)\n3. `@sequencemedia/react-redux-render` for React Redux apps (without React Router)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsequencemedia%2Freact-router-redux-render","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsequencemedia%2Freact-router-redux-render","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsequencemedia%2Freact-router-redux-render/lists"}