mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
aa926e349b
Summary: This PR is related to #24760 and adds the `openURLInBrowser` functionality introduced on react-native-community/cli#383. [General] [Changed] - Open links from new app in computer's browser. Pull Request resolved: https://github.com/facebook/react-native/pull/24843 Reviewed By: rickhanlonii Differential Revision: D15334011 Pulled By: cpojer fbshipit-source-id: 947ad1b113923989cf706e60851e02a87e1099e8
23 lines
471 B
JavaScript
23 lines
471 B
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
* @flow strict-local
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
const getDevServer = require('./getDevServer');
|
|
|
|
function openURLInBrowser(url: string) {
|
|
fetch(getDevServer().url + 'open-url', {
|
|
method: 'POST',
|
|
body: JSON.stringify({url}),
|
|
});
|
|
}
|
|
|
|
module.exports = openURLInBrowser;
|