# pagify-it

> Add routing to your React app in minutes.

Latest version **0.0.14** (published 2018-10-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install pagify-it
pnpm add pagify-it
yarn add pagify-it
bun add pagify-it
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.14 |
| Published | 2018-10-06 |
| First published | 2017-12-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 9.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | sonaye |

## Links

- npm: https://www.npmjs.com/package/pagify-it
- Repository: https://github.com/sonaye/pagify-it
- Homepage: https://github.com/sonaye/pagify-it#readme
- Issues: https://github.com/sonaye/pagify-it/issues
- npm.io page: https://npm.io/package/pagify-it

## Dependencies (1)

- [prop-types](https://npm.io/package/prop-types.md) ^15.6.2

## Recent versions

- 0.0.14 (latest) — 2018-10-06
- 0.0.13 — 2018-06-24
- 0.0.8 — 2018-06-11
- 0.0.7 — 2018-05-20
- 0.0.6 — 2018-03-31
- 0.0.5 — 2018-01-03
- 0.0.2 — 2017-12-30
- 0.0.1 — 2017-12-29

## README

# pagify-it

[![npm version](https://badge.fury.io/js/pagify-it.svg)](https://badge.fury.io/js/pagify-it)

## Install

`yarn add page pagify-it`

## Usage

```javascript
import Router, { Link, navigate, redirect } from 'pagify-it';

const Home = () => <div>HOME</div>;
const About = () => <div>ABOUT <Link to="/">HOME</Link></div>;
const Post = props => <div>POST # {props.ctx.params.id}</div>;

const routes = {
  '/': Home,
  '/about': About,
  '/post/:id': Post,
  '*': () => <div>404</div>
};

const App = () => <Router {...{ routes }} />;
// props: routes, opts (optional), base (optional), onChange(path, ctx) (optional)

// to display a link <a />, it accepts a base prop (optional) as well
<Link to="/posts" />

// to navigate to a certain path
navigate('/posts');

// to redirect to a certain path
redirect('/login');

// context: each rendered route will have a `ctx` prop with some routing metadata
```

## Docs

See [Page.js](https://visionmedia.github.io/page.js/).

## Example

Available [here](https://sonaye.github.io/pagify-it/) ([source](/example)).

**Note:** Routing with hashes is used in the example for hosting on GitHub pages, in a typical app you won't need it.

---
_Source: https://npm.io/package/pagify-it · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
