Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Fable.React.Types dependency #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<Project>
<!-- NuGet Metadata -->
<PropertyGroup>
<PackageProjectUrl>https://fable.io</PackageProjectUrl>
<RepositoryUrl>https://github.com/fable-compiler/fable-react-native</RepositoryUrl>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>fable_logo.png</PackageIcon>
<PackageTags>fsharp;fable;javascript;f#;js;react;react native</PackageTags>
<Authors>Fable contributors</Authors>
<GenerateDocumentationFile>true</GenerateDocumentationFile>

<!-- For SourceLink. See: https://github.com/dotnet/sourcelink#using-source-link-in-net-projects -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)\fable_logo.png" Pack="true" PackagePath="\" />
<None Include="$(MSBuildThisFileDirectory)\LICENSE" Pack="true" PackagePath="\" />
<None Include="$(MSBuildThisFileDirectory)\README.md" Pack="true" PackagePath="\"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>
</Project>
Binary file added fable_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ source https://www.nuget.org/api/v2
storage:none

nuget Fable.Core
nuget Fable.React
nuget Fable.React.Types prerelease
nuget Fable.Promise

group Build
Expand Down
35 changes: 19 additions & 16 deletions paket.lock
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
STORAGE: NONE
NUGET
remote: https://www.nuget.org/api/v2
Fable.Browser.Blob (1.1) - restriction: >= netstandard2.0
Fable.Browser.Blob (1.2) - restriction: >= netstandard2.0
Fable.Core (>= 3.0) - restriction: >= netstandard2.0
FSharp.Core (>= 4.6.2) - restriction: >= netstandard2.0
Fable.Browser.Dom (2.2) - restriction: >= netstandard2.0
Fable.Browser.Blob (>= 1.1) - restriction: >= netstandard2.0
Fable.Browser.Event (>= 1.2.1) - restriction: >= netstandard2.0
Fable.Browser.WebStorage (>= 1.0) - restriction: >= netstandard2.0
FSharp.Core (>= 4.7.2) - restriction: >= netstandard2.0
Fable.Browser.Dom (2.10) - restriction: >= netstandard2.0
Fable.Browser.Blob (>= 1.2) - restriction: >= netstandard2.0
Fable.Browser.Event (>= 1.5) - restriction: >= netstandard2.0
Fable.Browser.WebStorage (>= 1.1) - restriction: >= netstandard2.0
Fable.Core (>= 3.2.8) - restriction: >= netstandard2.0
FSharp.Core (>= 4.7.2) - restriction: >= netstandard2.0
Fable.Browser.Event (1.5) - restriction: >= netstandard2.0
Fable.Browser.Gamepad (>= 1.1) - restriction: >= netstandard2.0
Fable.Core (>= 3.0) - restriction: >= netstandard2.0
FSharp.Core (>= 4.7.2) - restriction: >= netstandard2.0
Fable.Browser.Event (1.2.1) - restriction: >= netstandard2.0
Fable.Browser.Gamepad (1.1) - restriction: >= netstandard2.0
Fable.Core (>= 3.0) - restriction: >= netstandard2.0
FSharp.Core (>= 4.7) - restriction: >= netstandard2.0
Fable.Browser.WebStorage (1.0) - restriction: >= netstandard2.0
Fable.Browser.Event (>= 1.0) - restriction: >= netstandard2.0
FSharp.Core (>= 4.7.2) - restriction: >= netstandard2.0
Fable.Browser.WebStorage (1.1) - restriction: >= netstandard2.0
Fable.Browser.Event (>= 1.5) - restriction: >= netstandard2.0
Fable.Core (>= 3.0) - restriction: >= netstandard2.0
FSharp.Core (>= 4.5.2) - restriction: >= netstandard2.0
Fable.Core (3.1.6)
FSharp.Core (>= 4.7.1) - restriction: >= netstandard2.0
FSharp.Core (>= 4.7.2) - restriction: >= netstandard2.0
Fable.Core (3.7.1)
Fable.Promise (2.1)
Fable.Core (>= 3.1.5) - restriction: >= netstandard2.0
FSharp.Core (>= 4.7) - restriction: >= netstandard2.0
Fable.React (7.2)
Fable.Browser.Dom (>= 2.0.1) - restriction: >= netstandard2.0
Fable.Core (>= 3.1.5) - restriction: >= netstandard2.0
Fable.React.Types (18.0.0-beta-002)
Fable.Browser.Dom (>= 2.4.4) - restriction: >= netstandard2.0
Fable.Core (>= 3.2.7) - restriction: >= netstandard2.0
FSharp.Core (>= 4.7.2) - restriction: >= netstandard2.0
FSharp.Core (5.0) - restriction: >= netstandard2.0

Expand Down
2 changes: 1 addition & 1 deletion paket.references
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Fable.Core
Fable.React
Fable.React.Types
Fable.Promise
7 changes: 7 additions & 0 deletions src/Fable.ReactNative.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1605,6 +1605,11 @@ module Props =
module Helpers =
open Props

/// Instantiate an imported React component. The first two arguments must be string literals, "default" can be used for the first one.
/// Example: `ofImport "Map" "leaflet" {| x = 10; y = 50 |} []`
let inline ofImport<'P> (importMember: string) (importPath: string) (props: 'P) (children: ReactElement seq): ReactElement =
ReactBindings.React.createElement(import importMember importPath, props, children)

[<Emit("$0")>]
// density independent pixels
let dip (_: float): ISizeUnit = jsNative
Expand Down Expand Up @@ -1653,6 +1658,8 @@ module Helpers =
let inline internal createElementWithObjProps(c: ReactElementType, props: obj, children: ReactElement seq) =
ReactBindings.React.createElement (c, props, children)

let inline str (s: string): ReactElement = unbox s

let inline text (props:ITextProperties list) (text:string): ReactElement =
createElement(RN.Text, props, [str text])

Expand Down
1 change: 1 addition & 0 deletions src/extra/react-native-camera/Fable.ReactNativeCamera.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ namespace Fable.ReactNativeCamera
open Fable.Core
open Fable.Core.JsInterop
open Fable.React
open Fable.ReactNative

module Props =

Expand Down
11 changes: 6 additions & 5 deletions src/extra/react-native-dialog/Fable.ReactNativeDialog.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ namespace Fable.ReactNativeDialog
open Fable.Core
open Fable.Core.JsInterop
open Fable.React
open Fable.ReactNative
open Fable.ReactNative.Props

type IButtonProperties =
Expand Down Expand Up @@ -55,19 +56,19 @@ module Helpers =
let title =
createObj [ ]
|> unbox
ReactElementType.create Dialog.Title title [ str text ]
ReactBindings.React.createElement(Dialog.Title, title, [ str text ])

let description (text:string) : ReactElement =
let description =
createObj [ ]
|> unbox
ReactElementType.create Dialog.Description description [ str text ]
ReactBindings.React.createElement(Dialog.Description, description, [ str text ])

let button (props:IButtonProperties list) : ReactElement =
ReactElementType.create Dialog.Button (keyValueList CaseRules.LowerFirst props) []
ReactBindings.React.createElement(Dialog.Button, keyValueList CaseRules.LowerFirst props, [])

let input (props:IInputProperties list) : ReactElement =
ReactElementType.create Dialog.Input (keyValueList CaseRules.LowerFirst props) []
ReactBindings.React.createElement(Dialog.Input, keyValueList CaseRules.LowerFirst props, [])

let container (props:IContainerProperties list) (children) : ReactElement =
ReactElementType.create Dialog.Container (keyValueList CaseRules.LowerFirst props) children
ReactBindings.React.createElement(Dialog.Container, keyValueList CaseRules.LowerFirst props, children)
4 changes: 2 additions & 2 deletions src/extra/react-native-maps/Fable.ReactNativeMaps.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ namespace Fable.ReactNativeMaps

open Fable.Core
open Fable.Core.JsInterop
open Fable.ReactNative.Props
open Fable.React.Helpers
open Fable.React
open Fable.ReactNative
open Fable.ReactNative.Props

type Region =
class end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ namespace Fable.ReactNativeDateTimePicker

open System
open Fable.Core.JsInterop
open Fable.ReactNative.Props
open Fable.React
open Fable.ReactNative
open Fable.ReactNative.Props

[<AutoOpen>]
module Helpers =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
namespace Fable.ReactNativeSignatureView

open Fable.Core
open Fable.Core.JsInterop
open Fable.ReactNative.Props
open Fable.React
open Fable.Core
open Fable.ReactNative
open Fable.ReactNative.Props

type SignatureViewRef() =
let signatureView = ref None
Expand Down