mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-09 01:26:24 +01:00
Fix useMatch not working with optional path segment
This commit is contained in:
parent
3aea09fd42
commit
692851b24c
1 changed files with 4 additions and 1 deletions
|
@ -16,7 +16,10 @@ function MediaModal({
|
||||||
onClose = () => {},
|
onClose = () => {},
|
||||||
}) {
|
}) {
|
||||||
const carouselRef = useRef(null);
|
const carouselRef = useRef(null);
|
||||||
const isStatusLocation = useMatch('/s/:instance?/:id');
|
// NOTE: Optional path segment doesn't work yet
|
||||||
|
// https://github.com/remix-run/react-router/issues/10039
|
||||||
|
// const isStatusLocation = useMatch('/s/:instance?/:id');
|
||||||
|
const isStatusLocation = useMatch('/s/:instance/:id') || useMatch('/s/:id');
|
||||||
|
|
||||||
const [currentIndex, setCurrentIndex] = useState(index);
|
const [currentIndex, setCurrentIndex] = useState(index);
|
||||||
const carouselFocusItem = useRef(null);
|
const carouselFocusItem = useRef(null);
|
||||||
|
|
Loading…
Reference in a new issue