Closed Th0rgal closed 4 years ago
When you import useParams
from preact-router
here there are multiple problems.
preact-router
rather than an export called useParams
.react-router
there are no useParams
hook. With preact-router
any url parameter is passed to the component as a props
. So you may want to remove the import and this line and replace this line with
export default function Ticket({ requestsManager, id }) {
// ...
}
Hello,
When I'm using a component my page is working: source code: https://github.com/cashplace/client/blob/3317123348ca253b7d378ff0918179d93b386888/cashplace/src/routes/ticket/index.js
But when I'm using a hook, I have an error: source code: https://github.com/cashplace/client/blob/d4c4b44c519f7fbbd74547ae044fa9442fd230ff/cashplace/src/routes/ticket/index.js
error:![error](https://media.discordapp.net/attachments/216216713711190016/743077572698439722/unknown.png)
I'm using it that way:
I'm not sure from where this issue comes from. If I didn't open this issue in the right place please tell it to me. Any help is appreciated!