-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Closed
Labels
BugPlatform: LinuxBuilding on Linux.Building on Linux.Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
Description
🐛 Bug Report
I used next code to check support URLSearchParams
if ( !global.URLSearchParams ) {
global.URLSearchParams = require('url-search-params')
}
But now it doesn't work because you add own "implementation"
react-native/Libraries/Blob/URL.js
Lines 69 to 71 in e605709
get(name) { | |
throw new Error('not implemented'); | |
} |
And a can't overwrite it
To Reproduce
const a = new URLSearchParams()
a.set('1','2');
a.toString()
Expected Behavior
My code don't broken!
Remove these polyfills:
react-native/Libraries/Core/setUpXHR.js
Lines 31 to 32 in e605709
polyfillGlobal('URL', () => require('URL').URL); // flowlint-line untyped-import:off | |
polyfillGlobal('URLSearchParams', () => require('URL').URLSearchParams); // flowlint-line untyped-import:off |
Code Example
// I try force set custom
global.URLSearchParams = require('url-search-params');
// But it works only with
import { polyfillGlobal } from 'react-native/Libraries/Utilities/PolyfillFunctions';
polyfillGlobal('URLSearchParams', () => require('url-search-params'));
Environment
React Native Environment Info:
System:
OS: Linux 4.15 Linux Mint 19.1 (Tessa)
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Memory: 1.27 GB / 15.51 GB
Shell: 2.7.1 - /usr/bin/fish
Binaries:
Node: 10.15.3 - /usr/bin/node
Yarn: 1.13.0 - /usr/bin/yarn
npm: 6.4.1 - /usr/bin/npm
npmPackages:
react: ^16.8.1 => 16.8.4
react-native: ^0.59.0 => 0.59.0
npmGlobalPackages:
react-native-cli: 2.0.1
Tino-F, AlvaroLarumbe, leethree, pavjacko, dctalbot and 13 moreTino-F, selim13, sejas and giioohbernini
Metadata
Metadata
Assignees
Labels
BugPlatform: LinuxBuilding on Linux.Building on Linux.Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.