@ruby-native/react 0.11.2 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.d.ts +11 -0
  2. package/index.js +12 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -16,6 +16,17 @@ export function NativeTabs({ enabled }: {
16
16
  * @returns {import("react").ReactElement}
17
17
  */
18
18
  export function NativePush(): import("react").ReactElement;
19
+ /**
20
+ * Who is signed in, as an opaque server-computed token (`native_identity_token`
21
+ * shared as an Inertia prop). Render on every page: an empty or missing token
22
+ * means signed out, and the app clears its screens when the value changes.
23
+ * @param {object} props
24
+ * @param {string | null} [props.token]
25
+ * @returns {import("react").ReactElement}
26
+ */
27
+ export function NativeIdentity({ token }: {
28
+ token?: string | null | undefined;
29
+ }): import("react").ReactElement;
19
30
  /**
20
31
  * @returns {import("react").ReactElement}
21
32
  */
package/index.js CHANGED
@@ -86,6 +86,18 @@ export function NativePush() {
86
86
  return createElement("div", { "data-native-push": true, hidden: true })
87
87
  }
88
88
 
89
+ /**
90
+ * Who is signed in, as an opaque server-computed token (`native_identity_token`
91
+ * shared as an Inertia prop). Render on every page: an empty or missing token
92
+ * means signed out, and the app clears its screens when the value changes.
93
+ * @param {object} props
94
+ * @param {string | null} [props.token]
95
+ * @returns {import("react").ReactElement}
96
+ */
97
+ export function NativeIdentity({ token }) {
98
+ return createElement("div", { "data-native-identity": token ?? "", hidden: true })
99
+ }
100
+
89
101
  /**
90
102
  * @returns {import("react").ReactElement}
91
103
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ruby-native/react",
3
- "version": "0.11.2",
3
+ "version": "0.12.0",
4
4
  "description": "React components for Ruby Native",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",