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

Update types to work with v6 data routers #584

Merged

Conversation

codecapitano
Copy link
Collaborator

@codecapitano codecapitano commented May 6, 2024

Why

There was type issue with newest react (data) router.
Add specific types for Index and NonIndex routes.
We took the necessary properties from the RouteObject type as defined by the remix/react router.

What

Update types in withFaroRouterInstrumentation to satisfy the React Router RouteObject type.

Links

Screenshots

Before

Screenshot 2024-05-06 at 12 41 41

After

Screenshot 2024-05-06 at 12 41 10

Checklist

  • Tests added
  • Changelog updated
  • Documentation updated

@codecapitano codecapitano linked an issue May 6, 2024 that may be closed by this pull request
@codecapitano codecapitano self-assigned this May 6, 2024
caseSensitive?: boolean;
children?: undefined;
element?: React.ReactNode | null;
index?: true;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think index shouldn't be optional here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch thank you 🙏

@codecapitano codecapitano force-pushed the 582-add-support-for-new-versions-of-react-router-dom branch from a79ce1f to 44ec391 Compare May 6, 2024 11:36
@codecapitano codecapitano merged commit aebb539 into main May 6, 2024
2 checks passed
@codecapitano codecapitano deleted the 582-add-support-for-new-versions-of-react-router-dom branch May 6, 2024 11:39
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

Successfully merging this pull request may close these issues.

Add support for new versions of react-router-dom
3 participants