-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Closed
Labels
Description
What version of React Router are you using?
6.3.0
Steps to Reproduce
import { matchPath } from "react-router-dom";
matchPath(
{ path: '/project/:type(type1|type2|type3|type4)/task/:taskId'},
'/project/type3/task/123'
); // returns null
Expected Behavior
should returned matched path value instead of null
{
params: {type: 'type3', taskId: '123'},
pathname: '/project/type3/task/123',
pathnameBase: '/project/type3/task/123',
pattern: { path: '/project/:type/task/:taskId', }
}
Actual Behavior
This returns null
insted of matched url.
This worked on v5, but not in v6 anymore. Is this intentional in v6?
matchPath(
{ path: '/project/:type(type1|type2|type3|type4)/task/:taskId'},
'/project/type3/task/123'
);