Removing vanilla encodeURIComponent, doing it manually for better control

This commit is contained in:
James Barnsley
2021-01-23 16:24:07 +13:00
parent 1bfc48e193
commit 4f561de7c5
22 changed files with 589 additions and 417 deletions

View File

@ -1,13 +1,14 @@
import React, { memo } from 'react';
import Link from './Link';
import { uriType as uriTypeHelper } from '../util/helpers';
import { encodeUri } from '../util/format';
export default memo((props) => {
let to = null;
let { uri, type } = props;
const uriType = type || uriTypeHelper(uri);
if (!props.unencoded) {
uri = encodeURIComponent(uri);
uri = encodeUri(uri);
}
switch (uriType) {