react-native-libraryrntestapp 0.1.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.
- package/LICENSE +20 -0
- package/Libraryrn.podspec +25 -0
- package/README.md +33 -0
- package/android/build.gradle +81 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/libraryrn/LibraryrnPackage.kt +17 -0
- package/android/src/main/java/com/libraryrn/LibraryrnViewManager.kt +20 -0
- package/ios/Libraryrn-Bridging-Header.h +2 -0
- package/ios/Libraryrn.mm +14 -0
- package/ios/Libraryrn.swift +8 -0
- package/lib/module/index.js +34 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/index.d.ts +5 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +159 -0
- package/src/index.tsx +35 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Tayyip GUZEL
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = "Libraryrn"
|
|
7
|
+
s.version = package["version"]
|
|
8
|
+
s.summary = package["description"]
|
|
9
|
+
s.homepage = package["homepage"]
|
|
10
|
+
s.license = package["license"]
|
|
11
|
+
s.authors = package["author"]
|
|
12
|
+
|
|
13
|
+
s.platforms = { :ios => min_ios_version_supported }
|
|
14
|
+
s.source = { :git => "https://github.com/tyypgzl/react-native-libraryrn.git", :tag => "#{s.version}" }
|
|
15
|
+
|
|
16
|
+
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
17
|
+
|
|
18
|
+
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
|
19
|
+
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|
|
20
|
+
if respond_to?(:install_modules_dependencies, true)
|
|
21
|
+
install_modules_dependencies(s)
|
|
22
|
+
else
|
|
23
|
+
s.dependency "React-Core"
|
|
24
|
+
end
|
|
25
|
+
end
|
package/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# react-native-libraryrn
|
|
2
|
+
|
|
3
|
+
a
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install react-native-libraryrn
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
```js
|
|
15
|
+
import { LibraryrnView } from "react-native-libraryrn";
|
|
16
|
+
|
|
17
|
+
// ...
|
|
18
|
+
|
|
19
|
+
<LibraryrnView color="tomato" />
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
## Contributing
|
|
24
|
+
|
|
25
|
+
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
|
|
26
|
+
|
|
27
|
+
## License
|
|
28
|
+
|
|
29
|
+
MIT
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
buildscript {
|
|
2
|
+
ext.getExtOrDefault = {name ->
|
|
3
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['Libraryrn_' + name]
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
repositories {
|
|
7
|
+
google()
|
|
8
|
+
mavenCentral()
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
dependencies {
|
|
12
|
+
classpath "com.android.tools.build:gradle:8.7.2"
|
|
13
|
+
// noinspection DifferentKotlinGradleVersion
|
|
14
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
apply plugin: "com.android.library"
|
|
20
|
+
apply plugin: "kotlin-android"
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def getExtOrIntegerDefault(name) {
|
|
24
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["Libraryrn_" + name]).toInteger()
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
def supportsNamespace() {
|
|
28
|
+
def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
|
|
29
|
+
def major = parsed[0].toInteger()
|
|
30
|
+
def minor = parsed[1].toInteger()
|
|
31
|
+
|
|
32
|
+
// Namespace support was added in 7.3.0
|
|
33
|
+
return (major == 7 && minor >= 3) || major >= 8
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
android {
|
|
37
|
+
if (supportsNamespace()) {
|
|
38
|
+
namespace "com.libraryrn"
|
|
39
|
+
|
|
40
|
+
sourceSets {
|
|
41
|
+
main {
|
|
42
|
+
manifest.srcFile "src/main/AndroidManifestNew.xml"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
|
|
48
|
+
|
|
49
|
+
defaultConfig {
|
|
50
|
+
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
|
51
|
+
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
buildTypes {
|
|
55
|
+
release {
|
|
56
|
+
minifyEnabled false
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
lintOptions {
|
|
61
|
+
disable "GradleCompatible"
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
compileOptions {
|
|
65
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
66
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
repositories {
|
|
71
|
+
mavenCentral()
|
|
72
|
+
google()
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
76
|
+
|
|
77
|
+
dependencies {
|
|
78
|
+
implementation "com.facebook.react:react-android"
|
|
79
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
80
|
+
}
|
|
81
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
package com.libraryrn
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.ReactPackage
|
|
4
|
+
import com.facebook.react.bridge.NativeModule
|
|
5
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
6
|
+
import com.facebook.react.uimanager.ViewManager
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class LibraryrnPackage : ReactPackage {
|
|
10
|
+
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
|
|
11
|
+
return emptyList()
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
|
|
15
|
+
return listOf(LibraryrnViewManager())
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
package com.libraryrn
|
|
2
|
+
|
|
3
|
+
import android.graphics.Color
|
|
4
|
+
import android.view.View
|
|
5
|
+
import com.facebook.react.uimanager.SimpleViewManager
|
|
6
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
7
|
+
import com.facebook.react.uimanager.annotations.ReactProp
|
|
8
|
+
|
|
9
|
+
class LibraryrnViewManager : SimpleViewManager<View>() {
|
|
10
|
+
override fun getName() = "LibraryrnView"
|
|
11
|
+
|
|
12
|
+
override fun createViewInstance(reactContext: ThemedReactContext): View {
|
|
13
|
+
return View(reactContext)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@ReactProp(name = "color")
|
|
17
|
+
fun setColor(view: View, color: String) {
|
|
18
|
+
view.setBackgroundColor(Color.parseColor(color))
|
|
19
|
+
}
|
|
20
|
+
}
|
package/ios/Libraryrn.mm
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#import <React/RCTBridgeModule.h>
|
|
2
|
+
|
|
3
|
+
@interface RCT_EXTERN_MODULE(Libraryrn, NSObject)
|
|
4
|
+
|
|
5
|
+
RCT_EXTERN_METHOD(multiply:(float)a withB:(float)b
|
|
6
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
7
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
8
|
+
|
|
9
|
+
+ (BOOL)requiresMainQueueSetup
|
|
10
|
+
{
|
|
11
|
+
return NO;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import { View, Text, Button } from 'react-native';
|
|
5
|
+
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
6
|
+
import Share from 'react-native-share';
|
|
7
|
+
import uuid from 'react-native-uuid';
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
export const LibraryrnView = ({
|
|
10
|
+
name
|
|
11
|
+
}) => {
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
const uuidValue = uuid.v4();
|
|
14
|
+
console.log('name', name);
|
|
15
|
+
console.log('uuidValue', uuidValue);
|
|
16
|
+
}, []);
|
|
17
|
+
return /*#__PURE__*/_jsx(SafeAreaView, {
|
|
18
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
19
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
20
|
+
children: "LibraryrnView"
|
|
21
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
22
|
+
title: "Share",
|
|
23
|
+
onPress: () => {
|
|
24
|
+
Share.open({
|
|
25
|
+
message: 'Test',
|
|
26
|
+
title: 'asdasd',
|
|
27
|
+
url: 'https://www.google.com'
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
})]
|
|
31
|
+
})
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","View","Text","Button","SafeAreaView","Share","uuid","jsx","_jsx","jsxs","_jsxs","LibraryrnView","name","uuidValue","v4","console","log","children","title","onPress","open","message","url"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,IAAI,EAAEC,IAAI,EAAEC,MAAM,QAAQ,cAAc;AACjD,SAASC,YAAY,QAAQ,gCAAgC;AAC7D,OAAOC,KAAK,MAAM,oBAAoB;AACtC,OAAOC,IAAI,MAAM,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAMrC,OAAO,MAAMC,aAA2C,GAAGA,CAAC;EAAEC;AAAK,CAAC,KAAK;EACvEZ,SAAS,CAAC,MAAM;IACd,MAAMa,SAAS,GAAGP,IAAI,CAACQ,EAAE,CAAC,CAAC;IAC3BC,OAAO,CAACC,GAAG,CAAC,MAAM,EAAEJ,IAAI,CAAC;IACzBG,OAAO,CAACC,GAAG,CAAC,WAAW,EAAEH,SAAS,CAAC;EACrC,CAAC,EAAE,EAAE,CAAC;EAEN,oBACEL,IAAA,CAACJ,YAAY;IAAAa,QAAA,eACXP,KAAA,CAACT,IAAI;MAAAgB,QAAA,gBACHT,IAAA,CAACN,IAAI;QAAAe,QAAA,EAAC;MAAa,CAAM,CAAC,eAC1BT,IAAA,CAACL,MAAM;QACLe,KAAK,EAAC,OAAO;QACbC,OAAO,EAAEA,CAAA,KAAM;UACbd,KAAK,CAACe,IAAI,CAAC;YACTC,OAAO,EAAE,MAAM;YACfH,KAAK,EAAE,QAAQ;YACfI,GAAG,EAAE;UACP,CAAC,CAAC;QACJ;MAAE,CACH,CAAC;IAAA,CACE;EAAC,CACK,CAAC;AAEnB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAwBtD,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "react-native-libraryrntestapp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "a",
|
|
5
|
+
"source": "./src/index.tsx",
|
|
6
|
+
"main": "./lib/module/index.js",
|
|
7
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
11
|
+
"default": "./lib/module/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"src",
|
|
17
|
+
"lib",
|
|
18
|
+
"android",
|
|
19
|
+
"ios",
|
|
20
|
+
"cpp",
|
|
21
|
+
"*.podspec",
|
|
22
|
+
"react-native.config.js",
|
|
23
|
+
"!ios/build",
|
|
24
|
+
"!android/build",
|
|
25
|
+
"!android/gradle",
|
|
26
|
+
"!android/gradlew",
|
|
27
|
+
"!android/gradlew.bat",
|
|
28
|
+
"!android/local.properties",
|
|
29
|
+
"!**/__tests__",
|
|
30
|
+
"!**/__fixtures__",
|
|
31
|
+
"!**/__mocks__",
|
|
32
|
+
"!**/.*"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"example": "yarn workspace react-native-libraryrn-example",
|
|
36
|
+
"test": "jest",
|
|
37
|
+
"typecheck": "tsc",
|
|
38
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
39
|
+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
40
|
+
"prepare": "bob build",
|
|
41
|
+
"release": "release-it"
|
|
42
|
+
},
|
|
43
|
+
"keywords": [
|
|
44
|
+
"react-native",
|
|
45
|
+
"ios",
|
|
46
|
+
"android"
|
|
47
|
+
],
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "git+https://github.com/tyypgzl/react-native-libraryrn.git"
|
|
51
|
+
},
|
|
52
|
+
"author": "Tayyip GUZEL <tguzeldev@gmail.com> (https://github.com/tyypgzl)",
|
|
53
|
+
"license": "MIT",
|
|
54
|
+
"bugs": {
|
|
55
|
+
"url": "https://github.com/tyypgzl/react-native-libraryrn/issues"
|
|
56
|
+
},
|
|
57
|
+
"homepage": "https://github.com/tyypgzl/react-native-libraryrn#readme",
|
|
58
|
+
"publishConfig": {
|
|
59
|
+
"registry": "https://registry.npmjs.org/"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@commitlint/config-conventional": "^19.6.0",
|
|
63
|
+
"@eslint/compat": "^1.2.7",
|
|
64
|
+
"@eslint/eslintrc": "^3.3.0",
|
|
65
|
+
"@eslint/js": "^9.22.0",
|
|
66
|
+
"@evilmartians/lefthook": "^1.5.0",
|
|
67
|
+
"@react-native/eslint-config": "^0.78.0",
|
|
68
|
+
"@release-it/conventional-changelog": "^9.0.2",
|
|
69
|
+
"@types/jest": "^29.5.5",
|
|
70
|
+
"@types/react": "^19.0.0",
|
|
71
|
+
"commitlint": "^19.6.1",
|
|
72
|
+
"del-cli": "^5.1.0",
|
|
73
|
+
"eslint": "^9.22.0",
|
|
74
|
+
"eslint-config-prettier": "^10.1.1",
|
|
75
|
+
"eslint-plugin-prettier": "^5.2.3",
|
|
76
|
+
"jest": "^29.7.0",
|
|
77
|
+
"prettier": "^3.0.3",
|
|
78
|
+
"react": "19.0.0",
|
|
79
|
+
"react-native": "0.78.2",
|
|
80
|
+
"react-native-builder-bob": "^0.40.17",
|
|
81
|
+
"release-it": "^17.10.0",
|
|
82
|
+
"turbo": "^1.10.7",
|
|
83
|
+
"typescript": "^5.2.2"
|
|
84
|
+
},
|
|
85
|
+
"peerDependencies": {
|
|
86
|
+
"react": "*",
|
|
87
|
+
"react-native": "*"
|
|
88
|
+
},
|
|
89
|
+
"workspaces": [
|
|
90
|
+
"example"
|
|
91
|
+
],
|
|
92
|
+
"packageManager": "yarn@3.6.1",
|
|
93
|
+
"jest": {
|
|
94
|
+
"preset": "react-native",
|
|
95
|
+
"modulePathIgnorePatterns": [
|
|
96
|
+
"<rootDir>/example/node_modules",
|
|
97
|
+
"<rootDir>/lib/"
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
"commitlint": {
|
|
101
|
+
"extends": [
|
|
102
|
+
"@commitlint/config-conventional"
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
"release-it": {
|
|
106
|
+
"git": {
|
|
107
|
+
"commitMessage": "chore: release ${version}",
|
|
108
|
+
"tagName": "v${version}"
|
|
109
|
+
},
|
|
110
|
+
"npm": {
|
|
111
|
+
"publish": true
|
|
112
|
+
},
|
|
113
|
+
"github": {
|
|
114
|
+
"release": true
|
|
115
|
+
},
|
|
116
|
+
"plugins": {
|
|
117
|
+
"@release-it/conventional-changelog": {
|
|
118
|
+
"preset": {
|
|
119
|
+
"name": "angular"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"prettier": {
|
|
125
|
+
"quoteProps": "consistent",
|
|
126
|
+
"singleQuote": true,
|
|
127
|
+
"tabWidth": 2,
|
|
128
|
+
"trailingComma": "es5",
|
|
129
|
+
"useTabs": false
|
|
130
|
+
},
|
|
131
|
+
"react-native-builder-bob": {
|
|
132
|
+
"source": "src",
|
|
133
|
+
"output": "lib",
|
|
134
|
+
"targets": [
|
|
135
|
+
[
|
|
136
|
+
"module",
|
|
137
|
+
{
|
|
138
|
+
"esm": true
|
|
139
|
+
}
|
|
140
|
+
],
|
|
141
|
+
[
|
|
142
|
+
"typescript",
|
|
143
|
+
{
|
|
144
|
+
"project": "tsconfig.build.json"
|
|
145
|
+
}
|
|
146
|
+
]
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
"create-react-native-library": {
|
|
150
|
+
"type": "legacy-view",
|
|
151
|
+
"languages": "kotlin-swift",
|
|
152
|
+
"version": "0.49.8"
|
|
153
|
+
},
|
|
154
|
+
"dependencies": {
|
|
155
|
+
"react-native-safe-area-context": "^5.6.2",
|
|
156
|
+
"react-native-share": "^12.2.2",
|
|
157
|
+
"react-native-uuid": "^2.0.3"
|
|
158
|
+
}
|
|
159
|
+
}
|
package/src/index.tsx
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { View, Text, Button } from 'react-native';
|
|
3
|
+
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
4
|
+
import Share from 'react-native-share';
|
|
5
|
+
import uuid from 'react-native-uuid';
|
|
6
|
+
|
|
7
|
+
export interface LibraryrnViewProps {
|
|
8
|
+
name: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const LibraryrnView: React.FC<LibraryrnViewProps> = ({ name }) => {
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
const uuidValue = uuid.v4();
|
|
14
|
+
console.log('name', name);
|
|
15
|
+
console.log('uuidValue', uuidValue);
|
|
16
|
+
}, []);
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<SafeAreaView>
|
|
20
|
+
<View>
|
|
21
|
+
<Text>LibraryrnView</Text>
|
|
22
|
+
<Button
|
|
23
|
+
title="Share"
|
|
24
|
+
onPress={() => {
|
|
25
|
+
Share.open({
|
|
26
|
+
message: 'Test',
|
|
27
|
+
title: 'asdasd',
|
|
28
|
+
url: 'https://www.google.com',
|
|
29
|
+
});
|
|
30
|
+
}}
|
|
31
|
+
/>
|
|
32
|
+
</View>
|
|
33
|
+
</SafeAreaView>
|
|
34
|
+
);
|
|
35
|
+
};
|