fable-import-react-native-image-picker

0.1.4 • Public • Published

fable-import-react-native-image-picker

Fable bindings for React Native Image Picker

Installation

Install fable-import-react-native and follow the instructions for that package.

Follow install instructions for react-native-image-picker and then:

$ npm install --save-dev fable-import-react-native-image-picker

Usage

Follow instructions for react-native-image-picker.

In F# project (.fsproj)

  <ItemGroup>
    <Compile Include="node_modules/able-import-react-native-image-picker/Fable.Import.ReactNativeImagePicker.fs" />
    <Compile Include="node_modules/able-import-react-native-image-picker/Fable.Helpers.ReactNativeImagePicker.fs" />
  </ItemGroup>

In F# script (.fsx)

#load "node_modules/able-import-react-native-image-picker/Fable.Import.ReactNativeImagePicker.fs"
#load "node_modules/able-import-react-native-image-picker/Fable.Helpers.ReactNativeImagePicker.fs"
 
open Fable.Core
open Fable.Import
module R = Fable.Helpers.React
module RN = Fable.Import.ReactNative
type IP = ReactImagePicker.Globals
open Fable.Helpers.ReactNativeImagePicker
open Fable.Helpers.ReactNativeImagePicker.Props
 
...
 
showImagePicker
  [Title "Image picker"; AllowsEditing true]
  (fun result -> 
    if not result.didCancel then
        if String.IsNullOrEmpty result.error then
            console.log("Image Uri: " + result.uri)
        else
            console.log("Error: " + result.error)
    else
        console.log("dialog canceled"))

Dependencies (1)

Dev Dependencies (2)

Package Sidebar

Install

npm i fable-import-react-native-image-picker

Weekly Downloads

5

Version

0.1.4

License

Apache-2.0

Last publish

Collaborators

  • alfonsogarciacaro
  • et1975
  • forki
  • k_cieslak