Skip to content

feat: move module out of RNC npm scope #404

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

Merged
merged 2 commits into from
Mar 5, 2021
Merged
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
29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

See this [issue](https://github.com/react-native-datetimepicker/datetimepicker/issues/313)

This repository was moved out of the react native community GH organization, in accordance to [this proposal](https://github.com/react-native-community/discussions-and-proposals/issues/176).
The module is still published on `npm` under the old namespace (as documented) but will be published under a new namespace soon, with a major version bump.
Note: the module was recently moved out of the `@react-native-community` npm scope. Please install from `@react-native-datetimepicker/datetimepicker`.

# React Native DateTimePicker

Expand Down Expand Up @@ -80,18 +79,18 @@ React Native date & time picker component for iOS, Android and Windows.

## Expo users notice

This module is part of Expo - [see docs](https://docs.expo.io/versions/latest/sdk/date-time-picker/). However, Expo SDK may not contain the latest version of the module and therefore, the newest features and bugfixes may not be available in Expo. Use the command `expo install @react-native-community/datetimepicker` (not `yarn` or `npm`) to install this module - Expo will automatically install the latest version compatible with your Expo SDK (which may _not_ be the latest version of the module available).
This module is part of Expo - [see docs](https://docs.expo.io/versions/latest/sdk/date-time-picker/). However, Expo SDK may not contain the latest version of the module and therefore, the newest features and bugfixes may not be available in Expo. Follow installation instructions in Expo docs - Expo will automatically install the latest version compatible with your Expo SDK (which may _not_ be the latest version of the module available).

## Getting started

```bash
npm install @react-native-community/datetimepicker --save
npm install @react-native-datetimepicker/datetimepicker --save
```

or

```bash
yarn add @react-native-community/datetimepicker
yarn add @react-native-datetimepicker/datetimepicker
```

Autolinking is not yet implemented on Windows, so [Manual installation](#windows) is needed.
Expand All @@ -105,7 +104,7 @@ If you are using RN >= 0.60, only run `npx pod-install`. Then rebuild your proje
For RN < 0.60, you need to link the dependency using `react-native link`:

```bash
react-native link @react-native-community/datetimepicker
react-native link @react-native-datetimepicker/datetimepicker
```

Then run `npx pod-install` and rebuild your project.
Expand All @@ -115,21 +114,21 @@ If this does not work, see [Manual installation](#manual-installation).
## General Usage

```js
import DateTimePicker from '@react-native-community/datetimepicker';
import DateTimePicker from '@react-native-datetimepicker/datetimepicker';
```

or

```js
const DateTimePicker = require('@react-native-community/datetimepicker');
const DateTimePicker = require('@react-native-datetimepicker/datetimepicker');
```

### Basic usage with state

```js
import React, {useState} from 'react';
import {View, Button, Platform} from 'react-native';
import DateTimePicker from '@react-native-community/datetimepicker';
import DateTimePicker from '@react-native-datetimepicker/datetimepicker';

export const App = () => {
const [date, setDate] = useState(new Date(1598051730000));
Expand Down Expand Up @@ -609,7 +608,7 @@ Please see [CONTRIBUTING.md](CONTRIBUTING.md)
platform :ios, '8.0'

# Point to the installed version
pod 'RNDateTimePicker', :path => '../node_modules/@react-native-community/datetimepicker/RNDateTimePicker.podspec'
pod 'RNDateTimePicker', :path => '../node_modules/@react-native-datetimepicker/datetimepicker/RNDateTimePicker.podspec'

# React/React-Native specific pods
pod 'React', :path => '../node_modules/react-native', :subspecs => [
Expand Down Expand Up @@ -641,16 +640,16 @@ Please see [CONTRIBUTING.md](CONTRIBUTING.md)
1. Add the following lines to `android/settings.gradle`:

```gradle
include ':@react-native-community_datetimepicker'
project(':@react-native-community_datetimepicker').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/datetimepicker/android')
include ':@react-native-datetimepicker_datetimepicker'
project(':@react-native-datetimepicker_datetimepicker').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-datetimepicker/datetimepicker/android')
```

2. Add the compile line to the dependencies in `android/app/build.gradle`:

```gradle
dependencies {
...
implementation project(':@react-native-community_datetimepicker')
implementation project(':@react-native-datetimepicker_datetimepicker')
}
```

Expand Down Expand Up @@ -678,7 +677,7 @@ Please see [CONTRIBUTING.md](CONTRIBUTING.md)

1. Open the solution in Visual Studio 2019
2. Right-click solution icon in Solution Explorer > Add > Existing Project
Select 'D:\pathToYourApp\node_modules\@react-native-community\datetimepicker\windows\DateTimePickerWindows\DateTimePickerWindows.vcxproj'
Select 'D:\pathToYourApp\node_modules\@react-native-datetimepicker\datetimepicker\windows\DateTimePickerWindows\DateTimePickerWindows.vcxproj'

##### **windows/myapp.sln**

Expand All @@ -704,7 +703,7 @@ Add `PackageProviders().Append(winrt::DateTimePicker::ReactPackageProvider());`
5. Run `yarn run start:ios` or `yarn run start:android` or `yarn run start:windows`
6. To do any development on the library, open the example project (in the example folder!) in xCode or Android Studio. The example project depends on the library code, which you can edit and observe any changes in the example project.

[circle-ci-badge]: https://img.shields.io/circleci/project/github/react-native-community/datetimepicker/master.svg?style=flat-square
[circle-ci-badge]: https://img.shields.io/circleci/project/github/react-native-datetimepicker/datetimepicker/master.svg?style=flat-square
[circle-ci-status]: https://circleci.com/gh/react-native-datetimepicker/datetimepicker.svg?style=svg
[support-badge]: https://img.shields.io/badge/platforms-android%20%7C%20ios%20%7C%20windows-lightgrey.svg?style=flat-square
[license-badge]: https://img.shields.io/npm/l/@react-native-community/slider.svg?style=flat-square
Expand Down
2 changes: 1 addition & 1 deletion RNDateTimePicker.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Pod::Spec.new do |s|
s.author = package['author']
s.homepage = package['homepage']
s.platform = :ios, "10.0"
s.source = { :git => "https://github.com/react-native-community/datetimepicker", :tag => "v#{s.version}" }
s.source = { :git => "https://github.com/react-native-datetimepicker/datetimepicker", :tag => "v#{s.version}" }
s.source_files = "ios/*.{h,m}"
s.requires_arc = true

Expand Down
2 changes: 1 addition & 1 deletion example/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
TextInput,
useColorScheme,
} from 'react-native';
import DateTimePicker from '@react-native-community/datetimepicker';
import DateTimePicker from '@react-native-datetimepicker/datetimepicker';
import SegmentedControl from '@react-native-community/segmented-control';
import {Colors} from 'react-native/Libraries/NewAppScreen';
import React, {useState} from 'react';
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ SPEC CHECKSUMS:
React-RCTText: fae545b10cfdb3d247c36c56f61a94cfd6dba41d
React-RCTVibration: 4356114dbcba4ce66991096e51a66e61eda51256
ReactCommon: ed4e11d27609d571e7eee8b65548efc191116eb3
RNDateTimePicker: 8a51a2216c307769e69ef827293d59549ab1ca23
RNDateTimePicker: 1da5ced941f52ef87c223da90225a7547c114bc3
Yoga: 3ebccbdd559724312790e7742142d062476b698e
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@react-native-community/datetimepicker",
"name": "@react-native-datetimepicker/datetimepicker",
"version": "3.0.9",
"description": "DateTimePicker component for React Native",
"main": "./src/index.js",
Expand Down Expand Up @@ -56,9 +56,9 @@
],
"license": "MIT",
"bugs": {
"url": "https://github.com/react-native-community/datetimepicker/issues"
"url": "https://github.com/react-native-datetimepicker/datetimepicker/issues"
},
"homepage": "https://github.com/react-native-community/datetimepicker#readme",
"homepage": "https://github.com/react-native-datetimepicker/datetimepicker#readme",
"devDependencies": {
"@babel/core": "^7.5.5",
"@babel/runtime": "^7.5.5",
Expand Down