npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-navigation-container

v1.0.6

Published

An enhanced react navigation container

Downloads

90

Readme

react-native-navigation-container

npm version styled with prettier

Table of Contents

About

The goal of react-native-navigation-container is to provide a convinient method to load static fonts and assets during the app splash screen and provide a development navigation that remains unchanged after app refresh.

First gif is without preloading assets using NavigationContainer. Second gif uses NavigationContainer to preload assets and it shows immediately after splash screen is done.

If you're interested in the implementations of the animations above visit this link

Features

  • Load static images and fonts while splash screen is showing.
  • Maintain navigation state after app refresh while in development mode.

Setup

This library is available on npm, install it with: npm i react-native-navigation-container or yarn add react-native-navigation-container.

Usage

Since react-native-navigation-container is an extension of the original react navigation NavigationContainer, it works in a similar fashion as react navigation - navigation container.

  1. Import react-native-navigation-container:
import NavigationContainer from 'react-native-navigation-container';
  1. Wrap root navigation with Navigation container:
export default function App() {
  return (
    <NavigationContainer>
      <RootNav />
    </NavigationContainer>
  );
}
  1. Prepare fonts and assets to be loaded:
const fonts = {
  'SofiaPro-Black': require('../../assets/fonts/SofiaProBlack.otf'),
  'SofiaPro-BlackItalic': require('../../assets/fonts/SofiaProBlackItalic.otf'),
};

const assets = [
  require('../../assets/images/img1.png'),
  require('../../assets/images/img2.png'),
];
  1. Add fonts and assets to navigation container:
export default function App() {
  return (
    <NavigationContainer fonts={fonts} assets={assets}>
      <RootNav />
    </NavigationContainer>
  );
}
  1. Optionally set the stickyNav prop:
export default function App() {
  return (
    <NavigationContainer fonts={fonts} assets={assets} stickyNav={true}>
      <RootNav />
    </NavigationContainer>
  );
}

A complete example

import React from 'react';
import NavigationContainer from 'react-native-navigation-container;

import { RootNav } from './src/navigation';

export default function App() {
  return (
    <NavigationContainer fonts={fonts} assets={assets} stickyNav={true}>
        <RootNav />
    </NavigationContainer>
  );
}

Available props

| Name | type | Description | | --------- | ------ | --------------------------------------------------------------- | | fonts | object | Fonts to be loaded into app | | assets | array | Static assets to be loaded into app | | stickyNav | bool | Maintains navigation state after app refresh - only in dev mode |