Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bs-react-native-navigation

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

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)

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 17 Mar 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc