# @jungle-mob/react-sitemap

> React Router Dom Sitemaps

Latest version **1.0.0** (published 2017-08-13) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @jungle-mob/react-sitemap
pnpm add @jungle-mob/react-sitemap
yarn add @jungle-mob/react-sitemap
bun add @jungle-mob/react-sitemap
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-08-13 |
| First published | 2017-08-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | roma_bb8 |

## Links

- npm: https://www.npmjs.com/package/@jungle-mob/react-sitemap
- Repository: https://github.com/jungle-mob/react-sitemap
- Homepage: https://github.com/jungle-mob/react-sitemap#readme
- Issues: https://github.com/jungle-mob/react-sitemap/issues
- npm.io page: https://npm.io/package/@jungle-mob/react-sitemap

## Dependencies (1)

- [xmlbuilder](https://npm.io/package/xmlbuilder.md) ^9.0.1

## Recent versions

- 1.0.0 (latest) — 2017-08-13

## README

# React Router Dom Sitemaps

React Router Dom Sitemaps

# Simple use

React app 

````jsx harmony
'use strict';

import React, {Component} from 'react';
import {BrowserRouter, Switch, Route} from 'react-router-dom';


export default class Application extends Component {

    render() {
        return (<BrowserRouter>
            <div>
                <header/>
                <nav/>
                <main>
                    <Switch>
                        <Route exact path='/' component={null} changefreq='monthly' priority='0.8'/>
                        <Route path='/products' component={null} changefreq='monthly' priority='0.8'/>
                        <Route path='/orders' component={null} changefreq='monthly' priority='0.8'/>
                        <Route path='/create/order' component={null} changefreq='monthly' priority='0.8'/>
                        <Route path='/orders' component={null} changefreq='monthly' priority='0.8'/>
                        <Route path='/add/waybill/to/order' component={null} changefreq='monthly' priority='0.8'/>
                        <Route path='/deliveries' component={null} changefreq='monthly' priority='0.8'/>
                        <Route path='/cancel/order' component={null} changefreq='monthly' priority='0.8'/>
                        <Route path='/archive/orders' component={null} changefreq='monthly' priority='0.8'/>
                        <Route path='/login' component={null} changefreq='monthly' priority='0.8'/>
                    </Switch>
                </main>
                <footer/>
            </div>
        </BrowserRouter>);
    }
}
````
Generate sitemap
```js
'use strict';

import path from 'path';
import fs from 'fs';
import Sitemap from '@jungle-mob/react-sitemap';

import App from 'App/App';

const sm = new Sitemap(new App().render());
let sitemap = sm.getSitemaps('https://test.com');
sitemap = '<?xml version="1.0" encoding="UTF-8"?>' + sitemap.toString();

fs.writeFileSync(path.join(__dirname, '..', 'sitemap.xml'), sitemap);
```

---
_Source: https://npm.io/package/@jungle-mob/react-sitemap · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
