Added comment to the docs that saveImageWithTag is deprecated
Summary: - [x] Explain the **motivation** for making this change. - [x] Provide a **test plan** demonstrating that the code is solid. - [x] Match the **code formatting** of the rest of the codebase. - [x] Target the `master` branch, NOT a "stable" branch. The CameraRoll docs have a method for `saveImageWithTag`. I wanted to know how to use it and how it differs from the other methods. So I open the react-native repo and used the source. I discovered this method is deprecated. It does use a console warning to notify upon use. A developer should not have to use a deprecated method to know it's no longer supported. The docs should state this until it is removed from the library. ```bash git clone https://github.com/facebook/react-native.git cd react-native npm install cd website npm install npm start open http://localhost:8079/react-native/docs/cameraroll.html ``` Verify there are comments for `saveImageWithTag` method notifying developers that it is deprecated. Closes https://github.com/facebook/react-native/pull/14345 Differential Revision: D5198453 Pulled By: shergin fbshipit-source-id: 2b74120a1ee450b903cdcff3812a83747dac5bb8
This commit is contained in:
parent
48107f5846
commit
005842408f
|
@ -121,9 +121,12 @@ class CameraRoll {
|
|||
static GroupTypesOptions: Object = GROUP_TYPES_OPTIONS;
|
||||
static AssetTypeOptions: Object = ASSET_TYPE_OPTIONS;
|
||||
|
||||
/**
|
||||
* `CameraRoll.saveImageWithTag()` is deprecated. Use `CameraRoll.saveToCameraRoll()` instead.
|
||||
*/
|
||||
static saveImageWithTag(tag: string): Promise<Object> {
|
||||
console.warn(
|
||||
'CameraRoll.saveImageWithTag is deprecated. Use CameraRoll.saveToCameraRoll instead',
|
||||
'`CameraRoll.saveImageWithTag()` is deprecated. Use `CameraRoll.saveToCameraRoll()` instead.',
|
||||
);
|
||||
return this.saveToCameraRoll(tag, 'photo');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue