Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
135 views
in Technique[技术] by (71.8m points)

How Can I Use Snapshot/Screenshot native module in react-native-macos

I'm using the react-native-macOS package but this package doesn't have usable documents for the macOS side. Normally, the react-native-macOS package has a Screenshot native component and they can use that component but when I wanna use it the way they use it:

const ScreenshotManager = NativeModules;

In takeScreenshot function :

ScreenshotManager.takeScreenshot('window', {format: 'jpeg', quality: 0.8})
  .then(uri => setURL(uri))
  .catch(error => console.log(error));

I can't use it because it says there is not like this component in my project but if I test the Screenshot component to RNTester folder in the react-native-macOS repo, everything is fine :/

Have you ever use this component or package before? How can I solve this problem?

Thanks for your help in advance

question from:https://stackoverflow.com/questions/65540926/how-can-i-use-snapshot-screenshot-native-module-in-react-native-macos

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...