Socket
Socket
Sign inDemoInstall

bs-react-native-navigation

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bs-react-native-navigation

![](https://img.shields.io/badge/license-MIT%20Licence-blue.svg)


Version published
Weekly downloads
1
Maintainers
1
Install size
914 kB
Created
Weekly downloads
 

Readme

Source

[@bs.module "react-native-navigation"]

BuckleScript bindings for react-native-navigation (from @Wix).

Getting started

(work in progress)

Usage example

(work in progress)

src/index.re

open BsReactNativeNavigation;

type screenId =
  | Drawer
  | Welcome;

let screenId = screenId =>
  (
    switch screenId {
    | Drawer => "screen.drawer"
    | Welcome => "screen.welcome"
    }
  )
  |> Core.asScreenId;

let registerScreens = () =>
  [
    (Welcome, Screens.Welcome.default),
    (Drawer, Screens.Drawer.default),
  ]
  |> List.iter(((screen, component)) =>
       Navigation.registerComponent(screenId(screen), () => component)
     );

let startApplication = () =>
  Navigation.(
    startSingleScreenApp(
      ~screen=
        Screen.make(
          ~screen=screenId(Welcome),
          ~title="Playground / TestApp",
          ()
        ),
      ~drawer=
        Drawer.(
          config(
            ~left=make(~screen=screenId(Drawer), ()),
            ~animationType=Animation.Parallax,
            ()
          )
        ),
      ~animationType=Animation.SlideDown,
      ()
    )
  );

index.js

import { registerScreens, startApplication } from './lib/js/src'

registerScreens()
startApplication()

Welcome.re (component)

open ReasonReact;

open BsReactNative;

open BsReactNativeNavigation;

let component = statelessComponent("Welcome");

let make = (~navigator, _children) => {
  ...component,
  render: _self =>
    /* whatever */
};

let default = Utils.nativeScreen(~component, ~make);

Utils.setNavigatorStyle(
  ~nativeScreen=default,
  ~navigatorStyle=
    Navigator.Style.(
      create([
        navBarTextColor("#fff"),
        navBarNoBorder(true),
        navBarBackgroundColor("#2575E6")
      ])
    )
);

Status

Check the current status here.

Disclaimer

This is work in progress, use with caution.

License

The MIT License.

See LICENSE

Keywords

FAQs

Last updated on 17 Mar 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc