Gatsby: Bypass react router path matching

Created on 29 Mar 2016  路  4Comments  路  Source: gatsbyjs/gatsby

I discovered recently that react-router can be very slow at matching routes https://github.com/reactjs/react-router/issues/3215

This will soon be (mostly) fixed but there'll still be 10-15 milliseconds spent matching the router (that's on a 2015 MBP so much much slower on an old android) that we should avoid.

We can load our own routing table into the browser and match path changes against that which will drop path matching times down to microseconds.

This will also probably make code splitting more convenient #10

Hacktoberfest help wanted

Most helpful comment

As of React Router v2.2.0, getComponent now gets called with the router state, including params.

All 4 comments

As of React Router v2.2.0, getComponent now gets called with the router state, including params.

This is great! Thanks!

Closing as very old

Was this page helpful?
0 / 5 - 0 ratings

Related issues

3CordGuy picture 3CordGuy  路  3Comments

kalinchernev picture kalinchernev  路  3Comments

hobochild picture hobochild  路  3Comments

andykais picture andykais  路  3Comments

totsteps picture totsteps  路  3Comments