Sitelet https://github.com/react/react/pull/9292
Skip to content

Move takeSnapshot from UIManager to ReactNative renderer(s) - #9292

Merged
bvaughn merged 2 commits into
react:masterfrom
bvaughn:ReactNative-takeSnapshot-sync
Mar 30, 2017
Merged

bvaughn merged 2 commits into
react:masterfrom
bvaughn:ReactNative-takeSnapshot-sync

Conversation

@bvaughn

@bvaughn bvaughn commented Mar 30, 2017

Copy link
Copy Markdown
Contributor

(This is an upstream sync from a change committed to fbsource.)

This prevents a potential cycle between UIManager <> ReactNative and unblocks flat bundling for ReactNative.

@bvaughn
bvaughn force-pushed the ReactNative-takeSnapshot-sync branch from 107d1ed to 53b3701 Compare March 30, 2017 17:54
@bvaughn

bvaughn commented Mar 30, 2017

Copy link
Copy Markdown
Contributor Author

Hey @spicyj, I think you reviewed D4767428. Maybe you could give this a quick once over when you get the chance. 😄

@bvaughn
bvaughn merged commit 004c937 into react:master Mar 30, 2017
@bvaughn
bvaughn deleted the ReactNative-takeSnapshot-sync branch March 30, 2017 20:10
@lucia-super

Copy link
Copy Markdown

Hi bvaughn,

Base on your update, I use ReactNative.takeSnapshot,

_import ReactNative, {
AppRegistry,
StyleSheet,
Text,
ScrollView,
View,
ListView,
TextInput,
ToolbarAndroid,
Button,
Alert,
Share,
takeSnapshot
} from 'react-native';

takeSnapshot(this.refs.orderList, {format: 'jpeg', quality: 0.8}).then(
(uri) => {
Alert.alert(
'截屏',
'截屏成功',
[
{text: 'OK', onPress: () => {
Share.share({title:"今日下单信息",message:JSON.stringify(that.state.data)}).then(that.showResult).catch((error) => that.setState({result: 'error: ' + error.message}));
}},
],
{ cancelable: false }
);
}
).catch(
(error) => alert(error)
);

# but there is an error occur:

UIManager.__takeSnapshot is not a function

What wrong with me about the code, should I need to add other plugins for it?

look forward to your reply.

mrizwanashiq pushed a commit to mrizwanashiq/react that referenced this pull request Jun 25, 2026
* Move takeSnapshot from UIManager to ReactNative renderer(s)

* Prettier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants