diff --git a/packages/native-stack/CHANGELOG.md b/packages/native-stack/CHANGELOG.md new file mode 100644 index 00000000..e69de29b diff --git a/packages/native-stack/LICENSE b/packages/native-stack/LICENSE new file mode 100644 index 00000000..9d268cb0 --- /dev/null +++ b/packages/native-stack/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 React Navigation Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/native-stack/README.md b/packages/native-stack/README.md new file mode 100644 index 00000000..a1cf3a8f --- /dev/null +++ b/packages/native-stack/README.md @@ -0,0 +1,5 @@ +# `@react-navigation/material-bottom-tabs` + +React Navigation integration for [native-stack](https://github.com/software-mansion/react-native-screens/tree/master/native-stack) component from [`react-native-screens`](https://github.com/software-mansion/react-native-screens). + +Installation instructions and documentation can be found on the [React Navigation website](https://reactnavigation.org/docs/6.x/native-stack-navigator/). diff --git a/packages/native-stack/package.json b/packages/native-stack/package.json new file mode 100644 index 00000000..29e48c73 --- /dev/null +++ b/packages/native-stack/package.json @@ -0,0 +1,74 @@ +{ + "name": "@react-navigation/native-stack", + "description": "Integration for native stack component from react-native-screens", + "version": "6.0.0", + "keywords": [ + "react-native-component", + "react-component", + "react-native", + "react-navigation", + "ios", + "android", + "native", + "stack" + ], + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/react-navigation/react-navigation.git", + "directory": "packages/native-stack" + }, + "bugs": { + "url": "https://github.com/software-mansion/react-native-screens/issues" + }, + "homepage": "https://github.com/software-mansion/react-native-screens#readme", + "main": "lib/commonjs/index.js", + "react-native": "src/index.tsx", + "source": "src/index.tsx", + "module": "lib/module/index.js", + "types": "lib/typescript/src/index.d.ts", + "files": [ + "src", + "lib", + "!**/__tests__" + ], + "sideEffects": false, + "publishConfig": { + "access": "public" + }, + "scripts": { + "prepare": "bob build", + "clean": "del lib" + }, + "devDependencies": { + "@react-navigation/native": "^6.0.0-next.8", + "@testing-library/react-native": "^7.2.0", + "@types/react": "^16.9.53", + "@types/react-native": "~0.64.4", + "react": "~16.13.1", + "react-native": "~0.63.4", + "react-native-builder-bob": "^0.18.1", + "react-native-screens": "^3.0.0", + "typescript": "^4.2.3" + }, + "peerDependencies": { + "@react-navigation/native": "^6.0.0", + "react": "*", + "react-native": "*", + "react-native-screens": ">= 3.0.0" + }, + "react-native-builder-bob": { + "source": "src", + "output": "lib", + "targets": [ + "commonjs", + "module", + [ + "typescript", + { + "project": "tsconfig.build.json" + } + ] + ] + } +} diff --git a/packages/native-stack/src/__tests__/index.test.tsx b/packages/native-stack/src/__tests__/index.test.tsx new file mode 100644 index 00000000..fd71bdf3 --- /dev/null +++ b/packages/native-stack/src/__tests__/index.test.tsx @@ -0,0 +1,36 @@ +import * as React from 'react'; +import { View, Text, Button } from 'react-native'; +import { render, fireEvent } from '@testing-library/react-native'; +import { NavigationContainer, ParamListBase } from '@react-navigation/native'; +import { createNativeStackNavigator, NativeStackScreenProps } from '../index'; + +it('renders a native-stack navigator with screens', async () => { + const Test = ({ + route, + navigation, + }: NativeStackScreenProps) => ( + + Screen {route.name} +