Skip to content

Commit

Permalink
Make react-router-dom treeshakable (#6465)
Browse files Browse the repository at this point in the history
* Update size snapshot

* Make react-router-dom treeshakable

* Revert nameExports change
  • Loading branch information
TrySound authored and mjackson committed Nov 8, 2018
1 parent e6e4500 commit 4aefa2f
Show file tree
Hide file tree
Showing 4 changed files with 143 additions and 30 deletions.
22 changes: 11 additions & 11 deletions packages/react-router-dom/.size-snapshot.json
@@ -1,26 +1,26 @@
{
"esm/react-router-dom.js": {
"bundled": 7978,
"minified": 4880,
"gzipped": 1618,
"bundled": 8022,
"minified": 4817,
"gzipped": 1612,
"treeshaked": {
"rollup": {
"code": 1250,
"code": 453,
"import_statements": 417
},
"webpack": {
"code": 3322
"code": 1661
}
}
},
"umd/react-router-dom.js": {
"bundled": 159709,
"minified": 57597,
"gzipped": 16540
"bundled": 126991,
"minified": 47032,
"gzipped": 14084
},
"umd/react-router-dom.min.js": {
"bundled": 97476,
"minified": 34651,
"gzipped": 10216
"bundled": 84909,
"minified": 30118,
"gzipped": 9978
}
}
4 changes: 0 additions & 4 deletions packages/react-router-dom/modules/Link.js
Expand Up @@ -12,10 +12,6 @@ function isModifiedEvent(event) {
* The public API for rendering a history-aware <a>.
*/
class Link extends React.Component {
static defaultProps = {
replace: false
};

handleClick(event, history) {
if (this.props.onClick) this.props.onClick(event);

Expand Down
9 changes: 2 additions & 7 deletions packages/react-router-dom/modules/NavLink.js
Expand Up @@ -12,8 +12,8 @@ function joinClassnames(...classnames) {
* A <Link> wrapper that knows if it's "active" or not.
*/
function NavLink({
"aria-current": ariaCurrent,
activeClassName,
"aria-current": ariaCurrent = "page",
activeClassName = "active",
activeStyle,
className: classNameProp,
exact,
Expand Down Expand Up @@ -59,11 +59,6 @@ function NavLink({
);
}

NavLink.defaultProps = {
"aria-current": "page",
activeClassName: "active"
};

if (__DEV__) {
const ariaCurrentType = PropTypes.oneOf([
"page",
Expand Down
138 changes: 130 additions & 8 deletions packages/react-router-dom/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4aefa2f

Please sign in to comment.