Skip to content

Commit

Permalink
linking config for NavigationContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
Freddy03h committed Dec 12, 2024
1 parent db66ce4 commit 45faa70
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Native.bs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
'use strict';


var Linking = {};

var NavigationContainer = {};

var ServerContainer = {};
Expand All @@ -9,6 +11,7 @@ var CommonActions = {};

var Link = {};

exports.Linking = Linking;
exports.NavigationContainer = NavigationContainer;
exports.ServerContainer = ServerContainer;
exports.CommonActions = CommonActions;
Expand Down
17 changes: 17 additions & 0 deletions src/Native.res
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,22 @@ external darkTheme: theme = "DarkTheme"
@module("@react-navigation/native")
external useTheme: unit => theme = "useTheme"

module Linking = {
type rec config = {
path?: string,
exact?: bool,
initialRouteName?: string,
screens?: screens,
}
and screens = dict<config>

type t = {
enabled?: bool,
prefixes: array<string>,
config?: config,
}
}

module NavigationContainer = {
type state = Js.Json.t
type navigationState = state => unit
Expand All @@ -30,6 +46,7 @@ module NavigationContainer = {
~onStateChange: navigationState=?,
~onReady: unit => unit=?,
~theme: theme=?,
~linking: Linking.t=?,
~children: React.element,
~independent: bool=?,
) => React.element = "NavigationContainer"
Expand Down

0 comments on commit 45faa70

Please sign in to comment.