Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-router bundle size #130

Closed
gitcatrat opened this issue Aug 2, 2020 · 1 comment
Closed

react-router bundle size #130

gitcatrat opened this issue Aug 2, 2020 · 1 comment

Comments

@gitcatrat
Copy link

gitcatrat commented Aug 2, 2020

Zero dependency, only 1308 bytes gzipped vs 17KB React Router.

Not sure if outdated information or something else (not excluding my own error) but react-router is about 11Kb in my estimations, not 17Kb. Not a huge difference by itself but relatively it is.

Total 19.84Kb, preact of it is 8.2Kb. These are not hyper exact sizes but accurate enough.

bundle

By the way, I love what you're doing.

I'm in the middle of app diet myself and I would have jumped on wouter train ASAP but I do a lot of fancy stuff with urls and the absence of Link API (particularly state) and history of last navigation unfortunately puts a stop to my conversion.

<NavLink
  className={props.className}
  activeClassName={active}
  exact={props.exact || true}
  to={{
    pathname: to,
    // search: "?sort=name",
    // hash: "#the-hash",
    state: state
  }}
/>
@molefrog
Copy link
Owner

molefrog commented Aug 3, 2020

@gitcatrat Thanks, that info was probably outdated. I fixed the README.

Regarding your transition: I know, the state/search support has been requested multiple times. Good news is I'm planning to release an improved useLocation hook soon that will allow to specify state and other navigation parameters. Stay tuned!

Related discussion: #102 (comment)

@molefrog molefrog closed this as completed Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants