# @collinbrewer/react-navigation-view

> React Navigation View

Latest version **0.3.0** (published 2019-02-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install @collinbrewer/react-navigation-view
pnpm add @collinbrewer/react-navigation-view
yarn add @collinbrewer/react-navigation-view
bun add @collinbrewer/react-navigation-view
```

## 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.3.0 |
| Published | 2019-02-02 |
| First published | 2016-08-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 350.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Collin Brewer |
| Maintainers | collinbrewer |
| Keywords | react, react-component |

## Links

- npm: https://www.npmjs.com/package/@collinbrewer/react-navigation-view
- Repository: https://github.com/collinbrewer/react-navigation-view
- Issues: https://github.com/collinbrewer/react-navigation-view/issues
- npm.io page: https://npm.io/package/@collinbrewer/react-navigation-view

## Dependencies (2)

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

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.3.0 (latest) — 2019-02-02
- 0.2.2 — 2016-11-27
- 0.2.1 — 2016-11-26
- 0.2.0 — 2016-11-26
- 0.1.1 — 2016-08-19
- 0.1.0 — 2016-08-15

## README

# React Navigation View
An iOS-inspired navigation view for React.

The API is modeled largely after react-navigation-controller minus some fusses I had with its implementation:
- The use of `cloneElement` which causes numerous reference issues
- Complaints from React(and subsequent issues) due to components being created outside of the navigation controller's `render` method

To overcome these issues, this component uses two approaches:

- **Uncontrolled** (like `react-navigation-controller`)
	1. The `defaultViews` prop will be used to render the initial state of the navigation stack
	2. The `pushView` method will not accept React components, but instead a function that returns a React component, so the creation can more appropriately be deferred until the `ReactNavigationView`s render method is called by React
- **Controlled**
	1. The children passed to `ReactNavigationView` will be used as the views for the navigation stack
	2. None of the mutation methods(`pushView`, `popView`, `popToRoot`) will affect the navigation stack

## Demo & Examples

<!-- Live demo: [collinbrewer.github.io/react-navigation-view](http://collinbrewer.github.io/react-navigation-view/) -->

To build the examples locally, run:

```sh
npm install
npm start
```

## Installation

```sh
npm install @collinbrewer/react-navigation-view -S
```

## Usage

```js
var ReactNavigationView = require('@collinbrewer/react-navigation-view');

<ReactNavigationView ref='navigationView'>Example</ReactNavigationView>

this.refs.navigationView.pushView(() => {
	return <div>Screen 2</div>
});
```

## License

ISC Licensed.  Copyright (c) 2016 Collin Brewer.

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