File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 1- const FetchLoad = async ( { params } ) => {
1+ import { LoaderFunctionArgs } from "react-router-dom" ;
2+ const FetchLoad = async ( { params } : LoaderFunctionArgs ) => {
23 const data = await fetch (
3- `https://jsonplaceholder.typicode.com/todos/${ params . id } ` ,
4+ `https://jsonplaceholder.typicode.com/todos/${ params . id } `
45 ) ;
56 const json = await data . json ( ) ;
67 console . log ( json ) ;
Original file line number Diff line number Diff line change 11import React from "react" ;
2- import { useParams as useReactDomParams } from "react-router-dom" ;
2+ import { useParams } from "react-router-dom" ;
33
44//overwrite the useParams for catchall params route
55export const useNextParams = ( ) => {
6- const params = useReactDomParams ( ) ;
6+ const params = useParams ( ) ;
77 let updatedParams : { [ key : string ] : any } = params ;
88
99 if ( Object . values ( params ) . length > 1 ) {
You can’t perform that action at this time.
0 commit comments