This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

react-native-layers
TypeScript icon, indicating that this package has built-in type declarations

0.7.6 • Public • Published

react-native-layers

version license downloads

Layers for React Native.

Setup

Using npm:

$ npm install react-native-layers

Using yarn:

$ yarn add react-native-layers

Preview

Demo

Guide

Add initial layer (or layers):

import { Layer, Layers } from "react-native-layers";
import BaseComponent from "./BaseComponent";

const ExampleApp = () => {
  return (
    <Layers>
      <Layer id={"_base"} component={BaseComponent} props={{}}/>
    </Layers>
  );
};

export default ExampleApp;

Add new layer dynamically:

import { View, Button } from "react-native";
import { useLayers } from "react-native-layers";
import ModalComponent from "./ModalComponent";

const ExampleScreen = () => {
  const layers = useLayers();

  const openModal = () => {
    layers.add({ id: "_modal", component: ModalComponent, props: {} });
  };

  return (
    <View>
      <Button title={"Open modal"} onPress={openModal}/>
    </View>
  );
}

export default ExampleScreen;

Package Sidebar

Install

npm i react-native-layers

Weekly Downloads

1

Version

0.7.6

License

ISC

Unpacked Size

6.11 kB

Total Files

14

Last publish

Collaborators

  • amensum