preactjs / preact-router

:earth_americas: URL router for Preact.
http://npm.im/preact-router
MIT License
1.01k stars 156 forks source link

Third Level Link Not Working #393

Closed Debdut closed 3 years ago

Debdut commented 3 years ago
<Router>
  <Specify path='/task/create/' />
  <Deadline path='/task/create/deadline' />
</Router>

When I open /task/create/deadline, it remains blank without any rendering.

marvinhagemeister commented 3 years ago

That's not enough information to be able to reproduce the scenario you're having and determine if this is in fact a bug.

I tried guessing what your setup is and it works as expected. Can't find any issues there.

import { h, render } from "preact";
import { Router } from "preact-router";

function A() {
  return <p>A</p>;
}

function B() {
  return <p>B</p>;
}

render(
  <Router>
    <div path="/">
      <a href="/foo/a">A</a><br />
      <a href="/foo/a/b">B</a>
    </div>
    <A path="/foo/a" />
    <B path="/foo/a/b" />
  </Router>,
  document.getElementById("app")
);

Are you sure that your <Deadline> component renders something visible?

Debdut commented 3 years ago

It works I had to use

<Create path='/task/create/:*?' />