8 lines
217 B
JavaScript
8 lines
217 B
JavaScript
import { useParams } from 'react-router-dom';
|
|
|
|
export function withRouter(Children) {
|
|
return (props) => {
|
|
const match = { params: useParams() };
|
|
return <Children {...props} match={match} />
|
|
}
|
|
} |