Skip to content

Commit fea56da

Browse files
jordanpapaleofacebook-github-bot
authored andcommitted
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 #14345 Differential Revision: D5198453 Pulled By: shergin fbshipit-source-id: 2b74120a1ee450b903cdcff3812a83747dac5bb8
1 parent ce52f40 commit fea56da

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Libraries/CameraRoll/CameraRoll.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,12 @@ class CameraRoll {
121121
static GroupTypesOptions: Object = GROUP_TYPES_OPTIONS;
122122
static AssetTypeOptions: Object = ASSET_TYPE_OPTIONS;
123123

124+
/**
125+
* `CameraRoll.saveImageWithTag()` is deprecated. Use `CameraRoll.saveToCameraRoll()` instead.
126+
*/
124127
static saveImageWithTag(tag: string): Promise<Object> {
125128
console.warn(
126-
'CameraRoll.saveImageWithTag is deprecated. Use CameraRoll.saveToCameraRoll instead',
129+
'`CameraRoll.saveImageWithTag()` is deprecated. Use `CameraRoll.saveToCameraRoll()` instead.',
127130
);
128131
return this.saveToCameraRoll(tag, 'photo');
129132
}

0 commit comments

Comments
 (0)