🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

fable-import-react-native

Package Overview
Dependencies
Maintainers
4
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fable-import-react-native

Fable bindings for React Native

0.12.1
latest
Source
npm
Version published
Weekly downloads
0
-100%
Maintainers
4
Weekly downloads
 
Created
Source

fable-import-react-native

Fable bindings for React Native

Installation

$ npm install --save react-native fable-core 
$ npm install --save-dev fable-import-react fable-import-react-native

Usage

In a F# project (.fsproj)

  <ItemGroup>
    <Reference Include="node_modules/fable-core/Fable.Core.dll" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="node_modules/fable-import-react/Fable.Import.React.fs" />    
    <Compile Include="node_modules/fable-import-react/Fable.Helpers.React.fs" />
    <Compile Include="node_modules/fable-import-react-native/Fable.Import.ReactNative.fs" />
    <Compile Include="node_modules/fable-import-react-native/Fable.Helpers.ReactNative.fs" />    
  </ItemGroup>

In a F# script (.fsx)

#r "node_modules/fable-core/Fable.Core.dll"
#load "node_modules/fable-import-react/Fable.Import.React.fs"
#load "node_modules/fable-import-react/Fable.Helpers.React.fs"
#load "node_modules/fable-import-react-native/Fable.Import.ReactNative.fs"
#load "node_modules/fable-import-react-native/Fable.Helpers.ReactNative.fs"

open Fable.Core
open Fable.Import
module R = Fable.Helpers.React
module RN = Fable.Import.ReactNative
open RN.Props

...

  let button =
    text [] "click me!"
    |> touchableHighlight [
        OnPress (fun () -> console.log("clicked!"))]
        
  let image =
    image 
      [ Source [ Uri "http://facebook.github.io/react/img/logo_og.png"; IsStatic true ]]      
      [ ]

                                
  view [] 
   [ image
     button ]


Keywords

fable

FAQs

Package last updated on 16 Nov 2016

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