# react-native-navigation-register-screens

> Easier way to register RNN components.

Latest version **1.3.0** (published 2020-09-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-navigation-register-screens
pnpm add react-native-navigation-register-screens
yarn add react-native-navigation-register-screens
bun add react-native-navigation-register-screens
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2020-09-11 |
| First published | 2019-10-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 8.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Karl Marx Lopez |
| Maintainers | karlmarxlopez |
| Keywords | react-native, react-native-navigation, navigation, utility |

## Links

- npm: https://www.npmjs.com/package/react-native-navigation-register-screens
- Repository: https://github.com/react-native-navigation-register-screens
- npm.io page: https://npm.io/package/react-native-navigation-register-screens

## Dependencies (1)

- [react-native-navigation](https://npm.io/package/react-native-navigation.md) ^7.0.0

## Alternatives

- [express-promise-router](https://npm.io/package/express-promise-router.md) — 736.1K weekly downloads
- [next-usequerystate](https://npm.io/package/next-usequerystate.md) — 29.8K weekly downloads
- [@bitkyc08/opencodex](https://npm.io/package/@bitkyc08/opencodex.md) — 4.6K weekly downloads
- [lynkr](https://npm.io/package/lynkr.md) — 575 weekly downloads
- [baremetal.js](https://npm.io/package/baremetal.js.md) — 42 weekly downloads

## Recent versions

- 1.3.0 (latest) — 2020-09-11
- 1.0.7 — 2020-02-01
- 1.0.6 — 2020-02-01
- 1.0.5 — 2020-01-15
- 1.0.4 — 2019-10-28
- 1.0.3 — 2019-10-28
- 1.0.1 — 2019-10-27
- 1.0.0 — 2019-10-27

## README

# react-native-navigation-register-screens

Easier way to register RNN components.

# Example

## Function Component

```tsx
import {
  ScreenFC,
} from 'react-native-navigation-register-screens';

type MyFunctionComponentProps = {
  hello: string,
};

const MyFunctionComponent: ScreenFC<MyFunctionComponentProps> = ({
  hello,
  componentId,
}) {
  console.log(componentId);
  return (
    <View>
      <Text>{hello}</Text>
    </View>
  );
};

MyFunctionComponent.screenName = 'MyApp.Screens.MyFunctionComponent';

MyFunctionComponent.options = props => {
  console.log(props);

  return {
    topBar: {
      title: {
        text: 'Pushed screen title',
      },
    },
  };
};
```

# Registering Screens

```ts
import {registerScreens} from 'react-native-navigation-register-screens';

registerScreens([MyFunctionComponent, MyClassComponent, MyPureComponent]);
```

# With providers

If your using `react-redux`'s `Provider` or other similar libraries, you can provide a third parameter as the callback function.

```tsx
import {Provider} from 'react-redux';
import store from '../store';

registerScreens(
  [MyFunctionComponent, MyClassComponent, MyPureComponent],
  (Component) => (props) => (
    <Provider store={store}>
      <Component {...props} />
    </Provider>
  ),
);
```

# License

`react-native-navigation-register-screens` is MIT licensed, as found in the [LICENSE](https://github.com/karlmarxlopez/react-native-navigation-register-screens/blob/master/LICENSE) file.

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