- 
                Notifications
    
You must be signed in to change notification settings  - Fork 2.7k
 
Add type deprecations for types now in React Router #5679
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
Conversation
      
          
      
      
            brophdawg11
  
      
      
      commented
        Mar 6, 2023 
      
    
  
- Where possible, use React Router types directly
 - Where we differ slightly in implementation or naming, deprecate the Remix type in favor of the React Router type
 
          🦋 Changeset detectedLatest commit: 503cc2d The changes in this PR will be included in the next version bump. This PR includes changesets to release 18 packages
 Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR  | 
    
| let headers = new Headers(responseInit.headers); | ||
| if (!headers.has("Content-Type")) { | ||
| headers.set("Content-Type", "application/json; charset=utf-8"); | ||
| } | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jacob-ebey I think this was only here from a copy/paste and eventually gets overwritten with text/remix-deferred anyway.  So we can just use the router defer verbatim (while keeping the return type casting)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should be fine.
| }) { | ||
| return <h1>Not Implemented!</h1>; | ||
| } | ||
| 
               | 
          
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer used
| ...responseInit, | ||
| headers, | ||
| }); | ||
| return routerJson(data, init); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use router methods directly, but preserve typecasting on the returned values
| 
           🤖 Hello there, We just published version  Thanks!  | 
    
Since remix-run/remix#5679 and remix v1.15.0, RouteData is no longer exported by Remix. The type is now provided by `@remix-run/router`.
Since remix-run/remix#5679 and remix v1.15.0, RouteData is no longer exported by Remix. The type is now provided by `@remix-run/router`.
Since remix-run/remix#5679 and remix v1.15.0, RouteData is no longer exported by Remix. The type is now provided by `@remix-run/router`.
Since remix-run/remix#5679 and remix v1.15.0, RouteData is no longer exported by Remix. The type is now provided by `@remix-run/router`.