-
Notifications
You must be signed in to change notification settings - Fork 13
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
[BUG] Not compatible with react-router v6 #13
Comments
v6 is now published to npm and is the recommended version going forward. They react-router docs and issues are really cryptic about the history module and they don't seem to even expose it in any way. I'm still searching around, but would be helpful to get some more eyes on the lookout for this. |
There's a HistoryRouter object that can be used in place of Router that solves this problem. |
In v6, |
@afefer I don't see any function named createHistory in "react-router-dom": "6.2.1", |
It's flagged as unstable in 6.2.1, so you can import it as: |
hmm may not be a good solution for production then, I will probably wait. Thank you @afefer. |
Can't we just have a custom event that reactplugin is listen to which having the pathname?
ReactPlugin can have a static method creating that event to make it easier for developer to use it. |
Hi all @changesbyjames @paularmstrong @afefer @MironV @XzaR90 |
|
Correct, because it has no way to identify how "long" it took to render the page, which fundamentally is what duration is about, where for the initial page this includes how long it took to download the resources up until the page load event. For a SPA, "generally" all resources are local. If you want to track async (loading views etc) then you would have to use (or do something like) the |
I am in the process of upgrading to react-router v6. I am comfortable using Are there further changes anticipated to increase compatibility with react-router v6, or is enabling auto route tracking and forgoing page view duration data the long term solution? Out of interest, how was page duration data calculated pre-v6 using the history object? |
@djswilly for previous router changes, we added a history listener. Since V6 does not expose history object like previous versions, we have to use an alternative way. But in general, we set default duration to 0 since duration is hard to calculate in SPA from our end. We have to update react plugin eventually as React version changes. But currently, we are going to keep this plugin version.😊 |
Does anyone have suggestion on capturing page duration for each route to measure site performance, it seems current SDK does not support page duration and it always set as 0. any suggestions or implementation options are much appreciated. |
The workaround using Would it be possible to update the README and describe how to use |
It's not a huge deal as v6 is currently in beta but there is no exposed concept of
history
anymore so the way that the react plugin works with the history object will be unsupported soon.See here for more detail: remix-run/react-router#7476
The text was updated successfully, but these errors were encountered: